php - Epoch to date is 3 years off -


I get an era time returning from a webservice which is about 3 years in PHP, but javascript and epochconverter.com OK in

JS:

WARNING ('book' + new date (1285565357893)); // This morning gives the right time on 27th September 2010, right!

PHP:

Echo Strawptime ('% x', 1285565357893); // gives a date in 2013, wrong!

Time zone has been set: Europe / Amsterdam

What am I doing wrong here?

OK, some simple time basics for you

Javascript date range ... When you pass a numeric value, this is the number of milliseconds to the constructor since the Unix Era (1 January 1900 00:00 GMT).

The date of PHP is measured as the number of seconds since the Unix era (January 1, 19:00: 00: 00 GMT).

convert from millisecond to second by dividing PHP by 1000.

  Echo Stufftime ('% x', floor (1285565357893/1000));  

Comments