|
|
Re: Client Time Zone [message #636057 is a reply to message #635584] |
Fri, 29 October 2010 08:19 |
Tiber Sept Messages: 32 Registered: February 2010 |
Member |
|
|
Hello Ralf,
I filed the Enhancement Request. I am not sure whether my use case really requires this feature.
The scenario is this. I need to work with the UTC timezone on the server, i.e. ( Calendar and DateFormat UTC, obviously Date is always UTC ) but the client should enter the date in his local time (mostly, in some explicit cases the timezone is predefined).
From what I could test, the DateTime widget delivers the time entered by the user in his/her local time zone, and I need to know that user time zone to make the conversion. Please correct me if I have missed something here.
I got a solution for now, I added two phase listeners, the first one uploads the following code:
var rightNow = new Date();
var jan = new Date( rightNow.getFullYear(), 0, 1, 2, 0, 0 );
var jul = new Date( rightNow.getFullYear(), 6, 1, 2, 0, 0);
var ofs = Math.max( jan.getTimezoneOffset(), jul.getTimezoneOffset() ) * 60000 * (-1);
var req = org.eclipse.swt.Request.getInstance();
req.addParameter( someConstant, ofs );
req.send();
and the second one waits for the result & converts it to java.uti.TimeZone - guessing the timezone from TimeZone.getAvailableIDs( rawOffset ) . Both remove themselves once they are run. I could not find anything better, would you have any ideas ?
Thanks & regards,
tibersept
[Updated on: Fri, 29 October 2010 11:24] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05731 seconds