views:

65

answers:

3

I am being returned this time format from an API:

1287498792000

Can anyone advise what format that is and how I would parse it in PHP?

+1  A: 
jensgram
Dont think so the current unixtimestamp is 1287652876, that way too far ahead in the future if thats the case?
madsleejensen
But in a ajavascript representation, which shows the standard timestamp multiplied by 1000. To get a normak timestamp, you'd have to divide it by 1000
Alex
@madsleejensen You're right. Edited, thanks.
jensgram
Alex you should put that as an answer! divide the value with 1000 and you get the unix timestamp :)
madsleejensen
A: 

It's a UNIX timestamp - it represents the count of seconds since January 1st, 1970. You can use PHP's date() function to convert it to a human readable format.

Narf
+10  A: 

This format is the Number of milliseconds since 1970-01-01.

Your date represents 2010-10-19 @ 14h33 if i'm not mistaken.

Just divide it by 1000 and use the standard php functions for unix timestamps like date to display it or getdate to extract the different parts.

VirtualBlackFox
Thanks! It was the *1000 that threw me.
kron