Re: Time Zones in Searches

Eric,

> I have no way currently to infer a users time zone.  In my case the ultimate would be if somehow I could get that 
> information from an HTTP request header in a JAVA servlet.  But, I don't know of any way to do this.  
> [...]  how else could I know what time zone they are in?

The HTTP request header is useless but you might explore using JavaScript to pass a timestamp to your servlet as an hidden parameter. That assumes that the user's computer clock is accurate and the technique is not daylight saving time safe (so you'll may have an hour of uncertainty for date and time calculated in the past or the furure). If you don't want to rely on the user system clock, you might simply want to ask your user what time and day it is for them.

Asking users about their time zone may not be as simple as it sounds. As you were able to see Java offers over a hundred different time zones. From a usability perspective you should avoid that the user has to go through the list each time. You might for example use cookies to remember their last time zone selection. Of course time zone names are locale dependent (a French would not know what "Mountain Standard Time" is) so you'll have to be carefull filling up your drop down box. Java has an API that allows to get time zone name based on the locale but I don't know how good is the data it serves.

> --Not sure the accuracy is completely necessary, but I am not sure how to avoid it from a technical architecture 
> perspective.  How would I totally ignore time zones during searches without storing every date/time in my system 
> twice??  The value once converted to UTC, and once in the local date/time.

It would be best to store UTC time stamp + time zone ID than UTC time stamp + local time stamp as you can guess the locale time from the time zone ID but not the reverse. That's if you are picky about normalization and don't mind the compution to retreive the local time.

Regards,
Thierry

<><><><><><><><><><><><><><><><><><><><><><>
www.i18ngurus.com - Open Internationalization Resources Directory

----- Original Message ----- 
From: Eric Kreiser 
To: 'Thierry Sourbier' ; Www-International-w3c-org (E-mail) 
Sent: Friday, October 26, 2001 9:30 PM
Subject: RE: Time Zones in Searches


--Yes, I think I need to convert to UTC.  I have data being entered for time zones all around the world, some for location based events and others for virtual event not tied to any specific location.  I need to be able to do resource checking across all these events to make sure I have all the resources available in that timeframe.
--I have no way currently to infer a users time zone.  In my case the ultimate would be if somehow I could get that information from an HTTP request header in a JAVA servlet.  But, I don't know of any way to do this.  This out asking the user, how else could I know what time zone they are in?  We have discussed storing this information in the database relative to each user...
--Not sure the accuracy is completely necessary, but I am not sure how to avoid it from a technical architecture perspective.  How would I totally ignore time zones during searches without storing every date/time in my system twice??  The value once converted to UTC, and once in the local date/time.

Yes, I am using JAVA 1.3 to do my date/time conversions to UTC, which thru our testing seems to be accurate.

Received on Sunday, 28 October 2001 17:44:43 UTC