Forum Moderators: open
Does anyone know how to convert a localtime number (provided by a server) to a date object, or a UTC string if necessary? Thanks in advance!
var timestamp = new Date(...);
When I try this, it doesn't work. :P
alert(new Date(1140296969))
this should return a time at about today, right? Well, instead, I get some time in 1970. Any idea why?
Unix timestamps are second based. JavaScript timestamps are millisecond based