JavaScript TimeStamp in MilliSeconds

I have a timestamp that looks like 09-MAR-11 04.52.43.246000000 AM.

I am trying to convert this to a time format in MilliSeconds, can someone please let me know how to do this? (I should only do this in JavaScript)

I ask for advice. Thank you

+4
source share
1 answer

parse() : returns milliseconds since midnight on January 1, 1970 for a given date and time.

 var milliSeconds = Date.parse('09-MAR-11 04:52:43:246000000 AM'); 

In your datestring, please change the hour / min / etc separator to : instead . , so JS can correctly recognize the date.

jsFiddle Demo

Javascript Date Functions

+3
source

Source: https://habr.com/ru/post/1345048/


All Articles