Search code examples
javascriptformatdatetime

Javascript format date /Date(-62135571600000)/


How do I format the following to a 'mm/dd/yyyy h:mm:ss' date in javascript?

/Date(-62135571600000)/

Solution

  • In my current time zone:

    new Date(-62135571600000); //=> Mon Jan 01 1 02:00:00 GMT-0500 (Eastern Standard Time)
    

    Is that what you're looking for? So you can easily pull out the date properties you want from that object to format it as you like...