Page 1 of 1

Web templates: Displaying timezone offset from UTC/GMT (eg "GMT+0100")

Posted: Sun 06 Sep 2020 6:18 pm
by martinu
I know that <#timeUTC> will display time in UTC/GMT, as opposed to local time, but is there a way of displaying the offset (eg "GMT+0100" or "+0100") between local time and UTC, so as to say "all times on this site are GMT+0100" or something like that?

I found a format string "0zzz" that can be applied to a time, but the example information on https://cumuluswiki.org/a/Webtags for "0zzz" seems to be wrong: it actually prints the time in UTC rather than a string that describes the offset. I tried <#time format="0zzz"> in the indexT.htm file and got the UTC time rather than time offset in hours.

(I've searched the forum for posts containing "UTC" or "GMT" in case the question had already been asked and answered, but there were no matches.)

Re: Web templates: Displaying timezone offset from UTC/GMT (eg "GMT+0100")

Posted: Sun 06 Sep 2020 6:28 pm
by mcrossley
The format string should be "zzz" not "0zzz" shouldn't it?

Re: Web templates: Displaying timezone offset from UTC/GMT (eg "GMT+0100")

Posted: Sun 06 Sep 2020 11:05 pm
by beteljuice
The wiki table "My Revised Table of Time and Date Output Modifiers" does state 0zzz :?

Re: Web templates: Displaying timezone offset from UTC/GMT (eg "GMT+0100")

Posted: Mon 07 Sep 2020 2:02 pm
by martinu
mcrossley wrote: Sun 06 Sep 2020 6:28 pm The format string should be "zzz" not "0zzz" shouldn't it?
Yes, <#time format="zzz"> works. Thanks for that!

Looks like an error in the Wiki list of keywords https://cumuluswiki.org/a/Webtags

Re: Web templates: Displaying timezone offset from UTC/GMT (eg "GMT+0100")

Posted: Mon 07 Sep 2020 2:30 pm
by martinu
martinu wrote: Mon 07 Sep 2020 2:02 pm
mcrossley wrote: Sun 06 Sep 2020 6:28 pm The format string should be "zzz" not "0zzz" shouldn't it?
Yes, <#time format="zzz"> works. Thanks for that!

Looks like an error in the Wiki list of keywords https://cumuluswiki.org/a/Webtags
Also I've spotted a couple of trivial formatting errors in the wiki, relating to the "V1" badge: you've got "{Version badge 1}}" in one place and "{{Version badge 1}" in another - in both cases, the number of opening and closing braces do not match.

Re: Web templates: Displaying timezone offset from UTC/GMT (eg "GMT+0100")

Posted: Mon 07 Sep 2020 4:22 pm
by freddie
I was about to correct these two issues, but somebody beat me to it :lol: