Node.js Date.parse() API Last Updated : 12 Mar, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The date-and-time.Date.parse() is a minimalist collection of functions for manipulating JS date and time module which is used to parse the date according to a certain pattern. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using CDN link.<script src="/https/www.geeksforgeeks.org/path/to/date-and-time.min.js"></script>Syntax: parse(dateString, arg)Parameters: This method takes the following arguments as parameters: dateString: It is the string object of the datearg: It is the required date format.Return Value: This method returns parsed date and time. Example 1: index.js // Node.js program to demonstrate the // Date.parse() method // Importing module const date = require('date-and-time') // Creating object of current date and time // by using Date() const now = new Date('07-03-2021'); // Parsing the date and time // by using date.parse() method const value = date.parse(now.toLocaleDateString(),'D/M/YYYY'); // Display the result console.log("parsed date and time : " + value) Run the index.js file using the following command: node index.jsOutput: parsed date and time : Thu Jan 01 1970 00:00:00 GMT+0530 (India Standard Time)Example 2: index.js // Node.js program to demonstrate the // Date.parse() method // Importing module const date = require('date-and-time') // Parsing the date and time // by using date.parse() method const value = date.parse('23:14:05 GMT+0900','HH:mm:ss [GMT]Z'); // Display the result console.log("Parsed date and time : " + value) Run the index.js file using the following command: node index.jsOutput: Parsed date and time : Thu Jan 01 1970 19:44:05 GMT+0530 (India Standard Time)Reference: https://github.com/knowledgecode/date-and-time Comment More infoAdvertise with us Next Article Node.js Date.parse() API R rohitprasad3 Follow Improve Article Tags : Web Technologies Node.js NodeJS-API NodeJS date-time Similar Reads Node.js Date.preparse() API The date-and-time.Date.preparse() is a minimalist collection of functions for manipulating JS date and time module which is used to pre-parse the date according to a certain pattern. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using 2 min read Moment.js Parse ASP.NET JSON Date Moment.js is a date library for JavaScript that parses, validates, manipulates, and formats dates. We can use the moment() function passed with a string to parse dates in ASP.NET JSON format. The moment() function is used to create a moment using a string representing a date in ASP.NET JSON format. 1 min read Node.js Date.format() API The date-and-time.Date.format() is a minimalist collection of functions for manipulating JS date and time module which is used to format the date according to a certain pattern. Required Module: Install the module by npm or used it locally.By using npm.npm install date-and-time --saveBy using CDN li 2 min read Node.js Date.compile() API The date-and-time.Date.compile() is a minimalist collection of functions for manipulating JS date and time module which is used to compile a format string for the parser. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using CDN link. 2 min read Node.js Date.isValid() API The date-and-time.Date.isValid() is a minimalist collection of functions for manipulating JS date and time module which is used to validate the particular date and time with its string format. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --sav 2 min read Like