Re: GMT Offset

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 61715
interpreted = N
texte = This is the one I like, I put it in my globals folder and can also feed in either the offset in days or minutes to get future or past times. [!] ------- UTCdate.inc ------- Takes optional parameter "offset" in minutes or "offsetdays" in days and returns current date/time in UTC long format Replace the {6:00:00} with your Normal Daylight Savings Time offset from UTC [/!][math show=F]utc_t1={[date %X]};utc_t3={01:00:00}[/math][!] [/!][if "[c_time]"="[raw][c_time][/raw]"][then][text show=F]c_time=06:00:00[/text][/then][/if][math show=F]utc_t2={[c_time]}[/math][!] [/!][math time&show=F]UTC={[date %X]}+{[c_time]}[if ("[date %Z]"^"Daylight")|("[date %Z]"^"CDT")][then]-{1:00:00}[/then][/if][/math][math show=F]expirestime=[utc_t1]+[utc_t2][if ("[date %Z]"^"Daylight")|("[date %Z]"^"CDT")][then]-[utc_t3][/then][/if][/math][!] [/!][math time&show=f]NOW={[date %X]}[/math][!] [/!][if "[offset]"="[raw][offset][/raw]"][!] [/!][then][!] [/!][math show=f]offsettime=0[/math][/then][!] [/!][else][!] [/!][math show=f]offsettime=[offset]*60[/math][/else][!] [/!][/if][!] --- Create the UTCdate variable [/!][math time&show=f]UTCdate=[UTC]+[offsettime][/math][!] --- Create the UTCexpires string [/!][text show=t]UTCexpires=[!] [/!][if ([UTC]>[NOW])&([UTCdate]>[UTC])&([UTCdate]<86400)][!] ---- all in the same day ---- [/!][then][!] [/!][date format=%a, %d %b %Y][!] [/!][/then][!] ---- at least one day later ---- [/!][else][!] [/!][math show=f]tr_date={[date]}[hideif [offsetdays]=[raw][offsetdays][/raw]]+[offsetdays][/hideif][/ math][format days_to_date %A, %d-%b-%Y][math][tr_date]+{00/[showif [expirestime]>86400][math]floor([expirestime]/86400)[/math][/ showif][showif [expirestime]<86401]01[/showif][!] [/!]/0000}[/math][/format][!] [/!][/else][!] [/!][/if][!] [/!] [Format Seconds_To_Time][UTCdate][/Format][!] [/!] GMT[/text][!] ----- NO EOL AT EOF -------[/!] On Apr 10, 2005, at 10:09 AM, Donovan Brooke wrote: >> How can webdna get the GMT offset from the server? >> Sincerely, >> Kenneth Grome >> www.kengrome.com ------------------------------------------------------------- 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: GMT Offset ( John Peacock 2005)
  2. Re: GMT Offset ( Bob Minor 2005)
  3. Re: GMT Offset ( Donovan Brooke 2005)
  4. GMT Offset ( Kenneth Grome 2005)
This is the one I like, I put it in my globals folder and can also feed in either the offset in days or minutes to get future or past times. [!] ------- UTCdate.inc ------- Takes optional parameter "offset" in minutes or "offsetdays" in days and returns current date/time in UTC long format Replace the {6:00:00} with your Normal Daylight Savings Time offset from UTC [/!][math show=F]utc_t1={[date %X]};utc_t3={01:00:00}[/math][!] [/!][if "[c_time]"="[raw][c_time][/raw]"][then][text show=F]c_time=06:00:00[/text][/then][/if][math show=F]utc_t2={[c_time]}[/math][!] [/!][math time&show=F]UTC={[date %X]}+{[c_time]}[if ("[date %Z]"^"Daylight")|("[date %Z]"^"CDT")][then]-{1:00:00}[/then][/if][/math][math show=F]expirestime=[utc_t1]+[utc_t2][if ("[date %Z]"^"Daylight")|("[date %Z]"^"CDT")][then]-[utc_t3][/then][/if][/math][!] [/!][math time&show=f]NOW={[date %X]}[/math][!] [/!][if "[offset]"="[raw][offset][/raw]"][!] [/!][then][!] [/!][math show=f]offsettime=0[/math][/then][!] [/!][else][!] [/!][math show=f]offsettime=[offset]*60[/math][/else][!] [/!][/if][!] --- Create the UTCdate variable [/!][math time&show=f]UTCdate=[UTC]+[offsettime][/math][!] --- Create the UTCexpires string [/!][text show=t]UTCexpires=[!] [/!][if ([UTC]>[NOW])&([UTCdate]>[UTC])&([UTCdate]<86400)][!] ---- all in the same day ---- [/!][then][!] [/!][date format=%a, %d %b %Y][!] [/!][/then][!] ---- at least one day later ---- [/!][else][!] [/!][math show=f]tr_date={[date]}[hideif [offsetdays]=[raw][offsetdays][/raw]]+[offsetdays][/hideif][/ math][format days_to_date %A, %d-%b-%Y][math][tr_date]+{00/[showif [expirestime]>86400][math]floor([expirestime]/86400)[/math][/ showif][showif [expirestime]<86401]01[/showif][!] [/!]/0000}[/math][/format][!] [/!][/else][!] [/!][/if][!] [/!] [Format Seconds_To_Time][UTCdate][/Format][!] [/!] GMT[/text][!] ----- NO EOL AT EOF -------[/!] On Apr 10, 2005, at 10:09 AM, Donovan Brooke wrote: >> How can webdna get the GMT offset from the server? >> Sincerely, >> Kenneth Grome >> www.kengrome.com ------------------------------------------------------------- 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/ Bob Minor

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:

Re:listfiles-looking for slick solution (1997) Checkboxes (1997) transferring password & username (2000) New Webcatalog for Mac (1997) OT: Unix Geek Needed (2005) PCS Frames-Default page is solution! (1997) list/menus (2000) [OT] Industry standard for missing orders (2003) Requiring that certain fields be completed (1997) [TEXT SECURE=T] (2000) Include a big block of text (1997) Webcat/Webmerchant part II (1998) Weird bug, or is there something amiss? (1997) RE: E-mailer error codes (1997) Misc Stuff That Might Help (1997) price on detail, but not shoppingcart (1997) Formating found categories (1997) Netscape v. IE (1997) Strange intermittent WebDNA problems (2008) emailer w/F2 (1997)