Michael Shmalko
Michael Shmalko

Reputation: 710

Backdating posts with Facebook Graph API

When backdating posts, and supplying the backdated_time parameter as UTC in ISO format, the API does pick up the parameter and creates a post, but date-time of the post is significantly off from the original UTC time stamp provided. For example: For a post backdated as 2013-12-18T00:53+0000 Facebook generated post that is 19hours off resulting UTC timestamp would be 2013-12-17T05:53+0000 To make it more clear:

Any help on workaround would be appreciated!

Upvotes: 4

Views: 1705

Answers (2)

danorton
danorton

Reputation: 12015

It's a bug in the Facebook Graph API. Facebook seem to be doing a timezone conversion on a time that doesn’t have (can’t have) a timezone. It seems to be relative to US Pacific local time (currently standard time = UTC - 0800).

I'm in US CST (UTC-0600), so the time I submit is always two hours off. As you’re in Sydney, you're on summer time and 19 hours away from Pacific Standard Time (UTC-0800). Beware that when the US Pacific Time Zone switches to summer time in March the offset will change. It will change again when you return back to standard time in April. (I don't have that problem, because I change standard/daylight in sync with PT.) Also beware that Facebook is liable to fix it in the meantime. (If they’re smart, they’ll change the name of the backdated_time parameter and continue to support it for those of us who are working around the bug.)

Put more succinctly: The offset difference is the number of seconds between the local time set on your account and US Pacific Time zone local time, adjusting each for standard and summer time shifts.

You can confirm this by looking at the HTML in the page. At the time stamp, you'll see some HTML that shows their epoch timestamp, which is different from the epoch time you submitted. In my case, I submitted a value of “1391749200”, while the HTML shows a value two hours earlier, “1391742000”:

<abbr title="Thursday, February 6, 2014 at 9:00pm" data-utime="1391742000" class="timestamp livetimestamp">

I don’t see this problem, however, when setting the scheduled_publish_time (future) value.

Upvotes: 3

Tom Chadaravicius
Tom Chadaravicius

Reputation: 393

Use a page token to post. With page token I get correct timing in UTC, the post is displayed adjusted to my timezone (UTC-6, US Central) Tom

Upvotes: 1

Related Questions