I create a timestamp with strtotime php function. My question is how to "reverse" timestamp to year, month, date, ... seconds etc using javascript ?
Asked
Active
Viewed 4,734 times
0
-
Reference: [PHP date functions](http://php.net/manual/en/ref.datetime.php) – Pekka Mar 23 '11 at 12:49
-
Reference: [PHP date functions (new, improved OOP way)](http://www.php.net/manual/en/class.datetime.php) – Pekka Mar 23 '11 at 12:50
-
possible duplicate of [How can I convert a php timestamp to the same format as new Date() in javaScript?](http://stackoverflow.com/questions/2415877/how-can-i-convert-a-php-timestamp-to-the-same-format-as-new-date-in-javascript) | also have a look at http://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript – Felix Kling Mar 23 '11 at 12:50
3 Answers
0
var date = new Date(seconds*1000);
where milliseconds is seconds since Jan 1970.

Robby Pond
- 73,164
- 16
- 126
- 119