I got from various sources that Facebook stores The start and end time of events as PST. But there must be something I’m missing. Take this facebook event which I created. I live in Italy and in fact when I insert the event time it says UTC + 2. I insert 2012-05-18 10.30 PM as the event start time. I Expect this to be saved as 1.30 PM Pacific time, because PST should be GMT -7 (because of daylight saving time). But if I do
$start = date("Y-m-d H:i:s", $facebook_event['start_time'] );
$start comes out 2012-05-19 05:30:00 which is 7 hours after the time I inserted! How is that possible? what am I missing?
EDIT – this is how I retrieve the event start_time
$fql = "SELECT
eid,
name,
description,
start_time,
end_time,
venue,
location,
update_time
FROM
event
WHERE
eid IN (SELECT eid FROM event_member WHERE uid = $id)" ;
$events = $facebook->api( array(
'method' => 'fql.query',
'query' => $fql,
) );
I don’t use the /$id/events/ api call because I always get back an empty set when I get my friends events
let me explain the Facebook timezone rules,
Facebook always assumes start_time or end_time you are sending are in pacific timezone. so its our responsibility to send them in pacific timezone.
In above case,
You inserted 2012-05-18 10.30 PM in EST but Facebook assumes that you are sending it in pacific time. so it converts in to UTC as 2012-05-19 05:30:00. which you will recive throuh API.
simply fb_stored_time = epoch(UTC(assumed_Pacific_time))