I'm running JSPWiki at Oneeyedmen. The server is hosted by WantJava.com in Denver, and I'm in England. This is quite practical, as they're awake when I'm hacking on it, but all the times printed in pages are given as MDT.

So my problem is how to get the times to display as GMT, even though the locale for my server knows it is way across the Atlantic.

I don't know these parts of Java well. Any thoughts?

--DuncanMcGregor

Hm. I guess the correct solution would be to set a cookie (in UserPreferences) containing your timezone difference, then apply that information in all places that display dates and times.

It would need a bit of work, but it wouldn't be that difficult, really.

--JanneJalkanen

I'd be happy to set the whole server (context) into GMT (it is, after all, time as God intended ;-).

--DuncanMcGregor

Well, that should be easy - just set the TZ environment variable of the servlet container process; it should work.

--JanneJalkanen


RichardCare suggests that the timezone could be parsed out of the request and used as the display zone.

Mmm... How do I get the local time out of the request? I don't think that browsers are required to send the local date in the HTTP request; at least a quick look through the HTTP spec didn't reveal such a thing. It would be nice to default to such a value, if it existed...

--JanneJalkanen

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-5) was last changed on 20-Jun-2002 16:40 by JanneJalkanen