Re: Time Zones + GMT

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 42386
interpreted = N
texte = Clint Davis wrote: > Since my server is located in the US Central Time Zone, I'm storing a time > zone preference in my database as the offset of Central Time (+1 for > Eastern, +0 for Central, -1 for Mountain, -2 Pacific). I need to use this > offset to calculate the correct date and time for the time zone specified by > the client in the database.Why don't you store the offsets as relative to GMT, because then you will always have a positive offset?> > I think I'm going to need to convert to GMT and back or something like that, > but I'm not sure. I want to display the results of the math as: > Weekday, Month DD, YYYY | HH:MM:am/pm. > [math time]localtime={[date %X]}+{[youroffset]:00:00}-{[offset]:00:00}[/math]Note that this will not work around midnight for anyone west of you, since you will be reporting the wrong date. Look in the archives for my MIMEHeaders.inc include file which has some convoluted logic to get this right...It would be very nice is WebDNA was extended to include GMT math, though this relies on the underlying gmtime() implementation of the O/S...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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
Clint Davis wrote: > Since my server is located in the US Central Time Zone, I'm storing a time > zone preference in my database as the offset of Central Time (+1 for > Eastern, +0 for Central, -1 for Mountain, -2 Pacific). I need to use this > offset to calculate the correct date and time for the time zone specified by > the client in the database.Why don't you store the offsets as relative to GMT, because then you will always have a positive offset?> > I think I'm going to need to convert to GMT and back or something like that, > but I'm not sure. I want to display the results of the math as: > Weekday, Month DD, YYYY | HH:MM:am/pm. > [math time]localtime={[date %X]}+{[youroffset]:00:00}-{[offset]:00:00}[/math]Note that this will not work around midnight for anyone west of you, since you will be reporting the wrong date. Look in the archives for my MIMEHeaders.inc include file which has some convoluted logic to get this right...It would be very nice is WebDNA was extended to include GMT math, though this relies on the underlying gmtime() implementation of the O/S...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://search.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:

WebDNA and Virtual Servers (2003) ACGI processing for .html (1997) Mauthonly followed by mauthcapture (2002) [WebDNA] Apache configuration fail when... (2013) verify online (1997) Error, 101 a DNS problem ? (1997) Webstar 1.3.1 PPC (1997) Changing SubTotal (2003) F3 crashing server (1997) WC2b15 File Corruption (1997) Thanks ! (1997) Sitebuilder / StoreBuilder - *related.db* (2008) Sorry WebDNA server not running (2002) [WebDNA] New Licenses (2009) $Replace with [founditems] (1997) searching for items that begin with a number (2004) Uh...can someone help me out with the b10? (1997) Shipping.db (1998) [SHOWIF]s and empty arguments (1997) F3 crashing server (1997)