Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

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

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
martinu
Posts: 93
Joined: Wed 01 Jan 2014 7:54 pm
Weather Station: Davis Vantage Vue
Operating System: Raspberry Pi: Raspbian Stretch
Location: Rudston, North Yorkshire

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

Post 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.)
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Post by mcrossley »

The format string should be "zzz" not "0zzz" shouldn't it?
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

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

Post by beteljuice »

The wiki table "My Revised Table of Time and Date Output Modifiers" does state 0zzz :?
Image
......................Imagine, what you will KNOW tomorrow !
martinu
Posts: 93
Joined: Wed 01 Jan 2014 7:54 pm
Weather Station: Davis Vantage Vue
Operating System: Raspberry Pi: Raspbian Stretch
Location: Rudston, North Yorkshire

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

Post 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
martinu
Posts: 93
Joined: Wed 01 Jan 2014 7:54 pm
Weather Station: Davis Vantage Vue
Operating System: Raspberry Pi: Raspbian Stretch
Location: Rudston, North Yorkshire

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

Post 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.
freddie
Posts: 2870
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 24.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

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

Post by freddie »

I was about to correct these two issues, but somebody beat me to it :lol:
Freddie
Image
Post Reply