The Unix epoch time 1354341600 translates to GMT: Sat, 01 Dec 2012 06:00:00 GMT (via http://www.epochconverter.com/).
Doing new Date(1354341600) on Javascript Fri Jan 16 1970 10:12:21 GMT-0600 (CST) (I'm in Illinois)
Relevant JSFiddle: http://jsfiddle.net/DAQkZ/
How do I get the correct Date/time in Javascript?
Gotta multiply by 1000... to get milliseconds since Jan 1, 1970
alert(new Date(1354341600*1000));
Your issue is with the units you're using. The "Time from epoch" is in seconds, and the JS Date is expecting Milliseconds.
Try this:
alert(new Date(1354341600000));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With