Requested Time Zone Support Now Active
POSTED BY: Haken
UPDATED: Monday, September 23, 2002 03:07
VIEWED: 8618
PAGE 3 of 4
Read the next message.
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
Try it now. BTW, the tagline now supports quotes.
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
Quote:OK, fixed. I'm a little suprised you don't support DST. Your server is Windows NT, right? Shouldn't be that hard.
Originally posted by Haken:
Try it now. BTW, the tagline now supports quotes.
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
We're not just talking about the US. I didn't even know that there was DST in London until Guantes told me about it when we were testing. So unless there's a database somewhere that I can use that specifically says what countries use DST, it can get quite complicated to implement.
BTW, Hawaii doesn't have DST for obvious reasons.
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
Quote:Obvious reasons?
Originally posted by Haken:
We're not just talking about the US. I didn't even know that there was DST in London until Guantes told me about it when we were testing. So unless there's a database somewhere that I can use that specifically says what countries use DST, it can get quite complicated to implement.
BTW, Hawaii doesn't have DST for obvious reasons.
My point is that NT has built-in time zone support. You feed it a GMT time and some kind of time zone designation and it does the rest -- including daylight savings adjustment.
http://msdn.microsoft.com/library/en-us/sysinfo/base/time.asp
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
Obvious reason meaning we have year round sunshine here. One could say that we have only one season--Summer. Though, it does rain a bit more during Winter. The other State in the US that has the same is Arizona, and they too does not have DST.
As for the Time Zone support in Windows, that's only for the local server/computer. The particular function that does the task is GetTimeZoneInformation and is usually used to retrieve information on the current time zone of the server/computer.
I wish it was as simple as passing the API a GMT offset and getting accurate time zone info for the offset, but it doesn't work that way simply because not every location within a time zone has DST.
So, really, there's no easy way to implement DST other than to let the user manually adjust it.
But for theory's sake, if letting the user adjust is not an option, then the way I would approach it is to build a database of time zone info for the various States (and Counties) in the US (Hawaii and Arizona does not have DST and Indiana belongs in three different time zones and not all zones have DST). That's just the US alone. Not too complicated if we just make adjustments for the mentioned exceptions.
But on a global scale, you can see how complicated it can get with all the different countries and their respective counties, provinces, prefectures, and whatnot. To complicate matters, the start and end dates of DST around the world are all different.
Take a look at this:
http://webexhibits.org/daylightsaving/g.html
You may ask, well, some of that info must be somewhere on the computer because the computer takes care of it. And it is--for most States and countries. It's stored in the registry. And that's probably where I would start if I were to add auto DST support. If you want to take a look in the registry, it's here:
HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/Time Zones
For NT, XP, etc..look under CurrentVersion.
But really, it's an overkill for the website. Besides, as extensive as the list is in the registry, it's neither complete nor totally accurate and is provided as general time zone support. Note that this is also where the API gets its info.
I would also have to obtain the location of the user to make use of the time zone info by querying the database to return with the correct DST data. Simply passing a GMT offset doesn't work in obtaining DST for a particular locale.
So, the point of all this is that while auto DST support is fairly simple to implement for the US, the same cannot be said when the rest of the world is taken into account. That pretty much sucks, doesn't it?
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
I'm not about to suggest that you maintain your own time zone database. I've actually worked on documentation for such databases, and it's even more complicated than you think it is. Check out this map:
http://aa.usno.navy.mil/faq/docs/world_tzones.html
Note that some countries use half-hour offsets. And southern hemisphere DST is backwards from northern.
So the only practical thing is to use a standard database. I was under that NT provided a way to use its database in code, but perhaps I'm mistaken. You can always download the TZ database and convert it to your purposes, but I suppose that's rather a lot of work for one small feature:
http://www.twinsun.com/tz/tz-link.htm
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
I work in Tech Support for the Ingres RDBMS (which you've probably never heard of) and I know what a headache DST can be. Our product has good support for both timezones and DST but even so it can still be confusing[1].
If the functions aren't available in the database/language you're using then you it's much easier to implement a straight offset and leave it at that.
Personally I think if DST had been invented after computers became commonplace it would have had a much harder time getting accepted.
Shug
[1] Right now some of you are thinking 'Confusing? it's really straightforward what's he on about?' am I right? Trust me it can get complicated real quick.
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
Quote:
Originally posted by Shuggie:
I work in Tech Support for the Ingres RDBMS (which you've probably never heard of)
Actually, I've worked with Ingres at my part time job on campus when I was in school. It ran on a couple of DEC mainframes. I've also worked with ADABASE and MTRIEVE, probably another couple that many in the PC World haven't heard of.
About the Time Zone database, it's good to know, thanks Zicsoft.
Perhaps not really within the scope of this website, but one of the things I've been dreaming about creating as a result of our little discussion on DST is perhaps a way for the website to ID and log the geographical location of visitors based on their IP addresses. Something in the line of VisualRoute, but not as fancy.
http://visualroute.visualware.com/
That combined with the Time Zone database, it might be a worthwhile research project to pursue. Though not too practical in the sense that IP addresses are arbitrarily allocated and there is no connection between an IP address and it's physical location.
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME
I'm all for the whole manual change or get over it idea.... I've got mine set to GMT even tho I'm not quite on it for the moment, but couldn't you add a "+DST", "-DST" and "No DST" check or radial button on the options to add or subtract the hour between set dates?
Like assume DST is between two fixed dates for everyone and have the extra hour shoved on for us in the North and taken off for those in the South. That way no database of places is needed since people can select it if they want DST.
Just a thought that might simplify the whole issue, maybe!
Phil
"I'm not ashamed. It's the computer age. Nerds are in. They're still in, right?" -Willow
NOTIFY: Y | REPLY | REPLY WITH QUOTE | PERMALINK | TOP | HOME