I have the Unix timestamp "1264529457", which translates into January 26, 2010, which is stored inside an input element named "america".
When initializing jQuery UI's Datepicker, I have the following code to set the default date:
defaultDate: $.datepicker.parseDate('@', $("input[name=america]").val()),
When I manually check to see what this comes out to in Firebug, it says "Thu Jan 15 1970 00:00:00 GMT-0500 (Eastern Standard Time) {}". Any idea what is wrong (the documentation for this function is a bit sparse, so I'm guessing I missed something)?
Unix time is stored in seconds while Javascript uses milliseconds. Try multiplying your Unix timestamp by 1000 first.
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