Hi Guys,
I was messing around with the Facebook API. Basiclly i created a calendar event on facebook starting at 19 Nov, 14:15 and end 15:15, then used the api to get the event as XML.
Now the event start date appeared as:
<start_time>1227042900</start_time>
<end_time>1227046500</end_time>
The 10-digit number represents the number of seconds since 1970 accurate down to the second, and is the most common way to express timestamp values, The
java Date constructor as far as i know takes a 13-digit number accurate down to the millisecond to work correctly and create a Date. So i multipled the xml timestamp number by 1000 to make it accurate down to millisecond and created the start date in java using the following code.
Which later displayed as 19 Nov 22:15 which was a discremency of 8 hours.
According to the facebook forum they think Since there's no timezone specified when you enter an event, it seems facebook stores it internally as US Pacific Standard Time (which is GMT-8). When it is exported as a timestamp, it gets "normalized" to standard timestamp conventions by expressing it as GMT. In other words when i enter 14:15, facebook will treat this as 14:15 USPST, which equals 22:15 GMT when converted above.
So i wonder can any body show me how to read the above xml timestamp result into java so it can be converted into the timezone of the user who created it. Facebook also stores the timezone of the user who queried the facebook server. My time zone appears as 0, So i wonder how can i in java give the facebook server time zone and event time start time, compare them to my time zone, get the discrmency and deduct as neccessary? Any help appreciated.
best
Mark Hughes
[ November 19, 2008: Message edited by: Mark Hughes ]
[ November 19, 2008: Message edited by: Mark Hughes ]