Re: Can GMT be called from the OS ?

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 56639
interpreted = N
texte = Tom Duke wrote: > I need to calculate GMT to keep the dates consistent on my sites. Is it > possible to call GMT from the operating system using [shell] or is there some > consistent calculation that I could use so that I can ensure that I get GMT > regardless of where the site is hosted. No. You would have to ask the user what time it is where they are when they sign up, then calculate the offset, and store it in a cookie for the next time they visit. It is trivial to know your server's offset and adjust so that all times are store in UTC (GMT is the old nomenclature), but displaying the local time correctly wherever you are in the world is hard. What problem are you actually trying to solve? How accurate do you have to be, or is it enough to cover the majority of the cases? > > I can get the timezone through [date %Z] but it doesn't give the offset - > maybe someone has a db with all the timezones and their offsets ? > It's called the Olsen database, and it is completely unsuitable for use by WebDNA. It is a set of iteration rules and date ranges which can be used to generate timezone offsets. This is a very complicated problem to crack, because there is no standard international method for determining the TZ. For example, looking at the size of the country of China, how many timezones do you think they have? HINT: remember what type of government exists there. For another example, there are at least a few locations around the globe where the offset it 30 minutes for part of the year. Plus, to add to the confusion, the three letter acronyms for timezones are not globally unique. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Can GMT be called from the OS ? ( "Tom Duke" 2004)
  2. Re: Can GMT be called from the OS ? ( Christer Olsson 2004)
  3. Re: Can GMT be called from the OS ? ( Gary Krockover 2004)
  4. Re: Can GMT be called from the OS ? ( "Tom Duke" 2004)
  5. Re: Can GMT be called from the OS ? ( John Peacock 2004)
  6. Can GMT be called from the OS ? ( "Tom Duke" 2004)
Tom Duke wrote: > I need to calculate GMT to keep the dates consistent on my sites. Is it > possible to call GMT from the operating system using [shell] or is there some > consistent calculation that I could use so that I can ensure that I get GMT > regardless of where the site is hosted. No. You would have to ask the user what time it is where they are when they sign up, then calculate the offset, and store it in a cookie for the next time they visit. It is trivial to know your server's offset and adjust so that all times are store in UTC (GMT is the old nomenclature), but displaying the local time correctly wherever you are in the world is hard. What problem are you actually trying to solve? How accurate do you have to be, or is it enough to cover the majority of the cases? > > I can get the timezone through [date %Z] but it doesn't give the offset - > maybe someone has a db with all the timezones and their offsets ? > It's called the Olsen database, and it is completely unsuitable for use by WebDNA. It is a set of iteration rules and date ranges which can be used to generate timezone offsets. This is a very complicated problem to crack, because there is no standard international method for determining the TZ. For example, looking at the size of the country of China, how many timezones do you think they have? HINT: remember what type of government exists there. For another example, there are at least a few locations around the globe where the offset it 30 minutes for part of the year. Plus, to add to the confusion, the three letter acronyms for timezones are not globally unique. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ John Peacock

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[protect admin] (1997) append=T problem (1998) Search design (1997) 5.0 Pricing (2003) Virtual hosting and webcatNT (1997) Undeliverable Mail (1997) [WebDNA] help with [ReturnRaw] - why is it killing the parse of the [include] file? (2009) Subtotal Not Calculated on Invoice.html (1998) search form problem.. (1997) Questions To Answer (1997) WebCat2b12 CGI Mac -- Problems propagating the cart through (1997) More on the email templates (I like it) (1997) Merging databases (1997) Secure server question (1997) [Fwd: Rotating Banners ... (was LinkExchange)] (1997) WC1.6 to WC2 date formatting -FIXED! (1997) time + (1998) Major Security Hole (1998) Unix DB Permission Error (2002) Unexpected comparison behavior change in 4.5.1 (2003)