Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Facebook Graph API Date to UNIX timestamp

Tags:

php

facebook

How might I convert a Facebook Graph API Date to a UNIX timestamp?

like image 518
wintercounter Avatar asked May 02 '12 16:05

wintercounter


1 Answers

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

like image 141
fuxes Avatar answered Nov 11 '22 06:11

fuxes