Results 1 to 2 of 2
Feb 9, 2013, 10:07 #1
- Join Date
- Apr 2011
- Mexico city, Mexico
- 1 Post(s)
- 0 Thread(s)
date.parse returning wrong result
I may be doing this the wrong way but I been following the documentation to get the amount of seconds since epoch and I am getting the wrong result.
Basically I have a string like this
var myDateString='2013 02 06 13:05:00';
or any other in same format so now I do this
Which returns Wed Feb 06 2013 13:05:00 GMT+0100,
Now, this thing I am running inside a jquery function which I am not sure if it is affecting it but I don't get why in the documentation says it will return the amount of seconds and it is returning a completely different thing.Do you get bothered because I do the same thing every day?
Do you question why I do it?
Then find something that you actually like doing!!!
Stop thinking on what I do.
Feb 11, 2013, 16:54 #2
- Join Date
- Jun 2007
- 219 Post(s)
- 12 Thread(s)
It does return the number of milliseconds.
If I do this:
var myDateString='2013 02 06 13:05:00'; myDateString=Date.parse(myDateString); console.log(myDateString);
Then I see the output as: 1360152300000
Maybe there is something else in your code that is affecting the result?