Reputation: 7468
How might I convert a Facebook Graph API Date to a UNIX timestamp?
Upvotes: 6
Views: 10485
Reputation: 418
Facebook recently added a feature where date/times will be returned in Unix timestamp format, simply add the date_format=U
query parameter to end of your Graph call. For example:
https://graph.facebook.com/me/events?date_format=U&access_token=.....
This will return time/dates in Unix timestamp format (such as 1309572000).
Note: As of now only the updated_time in timestamp format but not the start_time
Upvotes: 16
Reputation: 219794
I don't know the date format but I suspect it is in a common and/or standard format so strtotime()
should work just fine.
$timestamp = strtotime('2012-04-24T22:01:00+0000');
Upvotes: 6