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?
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?
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.
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.