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 ]
Thanks for your reply, yes i looked into what you suggested, now im thinking that even if i was just to create the formatted time to appear as the PST GMT-8 time than that would appear as the time entered when the event was created and would be correct. So i tried this code, basically create calendar object with GMT-8 timezone and hope that when i pass in the facebook time stamp it appears as the original time i enter when creating the event.
Now the event i created is as follows; Date:19 November 2008 Time:16:00 - 17:00
But the above code result is "Correct Time:2008-11-20 01:00" which is really off, any thoughts??
Depends where you are. If you are in Western North America, then by the time 4pm 19th November comes, it will be after midnight here (UK), so 1am 20th November looks right. You might need to put some sort of timezone correction in.
posted 10 years ago
Hi Campbell ,
Yup im based in Ireland, and i create the event intending to have it in Ireland, so id like to pull the event out and display it as the time i entered and not 01:00 in the morning. I finding it a bit tricky to say the least lol