I have a timestamp that looks like 09-MAR-11 04.52.43.246000000 AM.
I'm trying to convert this to a time format into MilliSeconds , Could anybody please let me know as how to achieve this ?? ( I Should do this inside JavaScript Only )
Please advice . Thanks .
I have a timestamp that looks like 09-MAR-11 04.52.43.246000000 AM.
I'm trying to convert this to a time format into MilliSeconds , Could anybody please let me know as how to achieve this ?? ( I Should do this inside JavaScript Only )
Please advice . Thanks .
Share Improve this question edited Jun 9, 2011 at 20:52 kapa 78.7k21 gold badges165 silver badges178 bronze badges asked Mar 24, 2011 at 7:10 user663724user6637241 Answer
Reset to default 10parse()
: Returns the number of milliseconds since midnight 1 January 1970 for a given date and time string passed to it.
var milliSeconds = Date.parse('09-MAR-11 04:52:43:246000000 AM');
In your datestring please change the hour/min/etc separator to :
instead of .
, so JS can recognize correctly the date.
jsFiddle Demo
Javascript Date Functions