Archive for March, 2011

Twitter time, Facebook time

March 28, 2011

With regards to the discrepancy between the Twitter and Facebook timestamps highlighted in my previous posting, I was actually a little uncomfortable in proclaiming that “Twitter was right and Facebook was wrong” because, frankly speaking, I didn’t know for certain. The evidence was what lawyers would probably call “circumstantial”. To say that Twitter wouldn’t be so stupid as to move their time backward when the US switched to DST doesn’t actually prove that they didn’t do such a thing.

So, I took another look.

Many people would know that what is diplayed on their web browsers is  encoded in a language called HTML. The browser that I use, Mozilla Firefox, has a neat tool that can show the HTML code for any portion of text shown on the browser. Just highlight said portion of text, right click and select “View Selection Source” from the drop-down menu. So, I tried doing this on the timestamp for the message Anwar tweeted which Twitter said was at 11.39pm and Facebook said was at 10.40pm, February 21st.

For Twitter, this is what I got:
Twitter HTML source
The interesting portion here is not the text “11:39 PM Feb 21st”, but the attribute “data-time” which has a value of 1298302774000. This is the actual timestamp of the tweet and it is not affected by DST. It is encoded in a format used by most computers which is called “Unix Time” or “Epoch Time”. What it is is the number of milliseconds since the computing “Epoch”, i.e. midnight January 1st, 1970 (UTC  or GMT). To convert this time to a format we humans can read, one can go to a website, such as (before you try this, you  should make sure that the timezone on your computer is correct). Below is the result of the conversion
Twitter time converted
So, it seems that the time shown on Twitter is, in fact, correct.

For Facebook, the HTML source is:

It seems that  Facebook does not store its timestamp in Unix Time, but in a more readable text format. The attribute “data-date” gives the time of the post at “Mon, 21 Feb 2011 07:40:12 -0800”. Again, this time too would not have been affected by DST because it gives a reference to UTC in “-800”. That means the time shown is 8 hours behind UTC. Given that the Malaysian timezone is UTC +8, to convert this to Malaysian local time one needs to add 16 hours. 07:40:12 + 16 hours gives us 23:40:12, which is consistent with the time shown by Twitter.

So yes, now I can proclaim with confidence that Twitter was right and Facebook was wrong.


Anwar Ibrahim’s Facebook Alibi

March 27, 2011

A video has emerged purportedly showing Anwar Ibrahim having sex with a Chinese prostitute. The time shown on the video was from 10.21pm to 10.45pm on February 21, 2011. As part of his alibi, Anwar has cited several posts from his Facebook account timestamped between 10.40pm to  11.08pm the same night.
Facebook Feb 21, 10.40pm
The first thing to note is the phrase “via Selective Tweets” attached to these posts. What this means is that these posts were actually Twitter tweets that were automatically updated to Facebook by the Selective Tweets application. Indeed, for the Facebook post timestamped 10.40pm above, below is the corresponding tweet on Twitter:
Twitter feb 21
However there is a problem. The timestamp on Twitter shows that the message was tweeted at 11.39pm, almost an hour after it was supposed to have appeared on Facebook. If the message had originated from Twitter, how could it have appeared on Facebook long before Twitter itself. One of these timestamps must have been wrong. The question is which one?

Shown below is another of Anwar’s tweets that was automatically posted by Selective Tweets on Facebook, this time from March 13th. This time there wasn’t a 1 hour difference in the Twitter and Facebook timestamps. In fact, for all of his posts after March 13th, there was no discrepancy in the Twitter and Facebook timestamps.

Facebook 13 MarchTwitter March 13

On the other hand, all his posts before March 13th do show the 1 hour discrepancy. Below is another one from March 12th.
Facebook Mar 12Twitter Mar 12
This means that on March 13, either the time on Twitter was moved backward by 1 hour or the time on Facebook was moved forward by 1 hour. Actually, what happened on March 13th was that all clocks in the United States were moved forward by 1 hour in observance of Daylight Saving Time. Therefore, we can safely assume that it was the time on Facebook that had been moved forward (It doesn’t make sense that Twitter would move their time backward when everyone else in the US was doing the opposite).

Since Malaysia does not observe Daylight Saving Time AND the time on Facebook was moved forward by 1 hour after March 13th AND timestamps on Facebook after March 13th are correct (because they are now in sync with Twitter and it is unlikely that both are wrong), it can only mean that the time on Facebook before March 13th was wrong and was behind by 1 hour. That would also mean that Anwar was not actively posting on Facebook at the time the video was recorded.