Moment.js Parse ASP.NET JSON Date Last Updated : 10 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Syntax: moment( String ) Parameters: It takes a string that represents the date in ASP.NET JSON format. Returns: A Moment object. Example 1: JavaScript import moment from 'moment'; let day = "/Date(1158639712897)/" let date = moment(day); console.log(date.format("DD/MM/YYYY-H:mm:ss")); Output: Example 2: JavaScript import moment from 'moment'; let day = "/Date(1558639712897)/" let date = moment(day); console.log(date.format("dddd, Do MMM YYYY, h:mm:ss A")); Output: Reference: https://momentjs.com/docs/#/parsing/asp-net-json-date/ Comment More infoAdvertise with us Next Article Moment.js Parse ASP.NET JSON Date A aayushmohansinha Follow Improve Article Tags : Web Technologies Node.js Moment.js Moment.js-Parse Similar Reads Node.js Date.parse() API 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 lin 2 min read 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 Parsing Date Moment.js is a date library for JavaScript that parses, validates, manipulates, and formats dates. We can use the moment() function passed with an object to parse dates represented as Date object. The moment() function is used to create a moment using a Date object. Syntax: moment( Date ) Parameters 1 min read Moment.js Parsing Defaults Moment.js is a date library for JavaScript that parses, validates, manipulates, and formats dates. We can use the moment() function by providing only a few parameters and the rest will default to the current day, month, or year and 0 for an hour, minute, second, and millisecond. The moment() functio 1 min read Moment.js Parse Date Format Plugin Parse Date Format is a moment.js plugin to can be used to extract a date/time string's format from a given string. This format can then be later used with other Moment methods. Write the below command in the terminal to install Date Format Plugin: npm install moment-parseformat The following are so 1 min read Like