Page 1 of 1

[Request] Webtag to Provide Times in UTC

Posted: Thu 09 Jul 2020 1:29 am
by buffaloseven
Hi,

Just wondering now that development is moving along at a good clip, if it would be possible to give a web tag that would give timestamps in UTC format. Something like

Code: Select all

<#RecentTSUTC>
would be great. The removal of the local time zone setting of the station would make it much easier to provide station data at a uniform time, particularly as Javascript doesn't really support time zones that well, but can work well enough if the source time is in UTC.

Other than that, super happy to see all the development that's been going on! CumulusMX is a fantastic piece of logging software. :-)

Re: [Request] Webtag to Provide Times in UTC

Posted: Thu 09 Jul 2020 6:39 am
by sfws
buffaloseven wrote: Thu 09 Jul 2020 1:29 am a web tag that would give timestamps in UTC format
<#timeUTC> existed for Cumulus 1 (since version 1.9.2) and exists for Cumulus 3, also known as MX, in all its versions.

Well a capital "K" can replace other specifiers to make the time output specify time-zone, and adding a lower case "zzz" after other specifiers will give hours and minutes offset from UTC, but I suspect (as I have not experimented) these only apply to current date/time.

Cumulus 2 worked entirely in UTC which Steve Loft expected to simplify everything.
However, the complications that invoked in practice are probably part of the reason why Cumulus 2 was abandoned.


But I wonder whether you actually asked the question you meant to ask.
Perhaps you meant to ask can every time-stamp be formatted to output in UTC?

As far as I know there is not a output format specifier to output times in web tags (not representing current time) always in UTC, maybe someone else will correct me if I am wrong.

Re: [Request] Webtag to Provide Times in UTC

Posted: Thu 09 Jul 2020 7:48 am
by mcrossley
There is also <#timeJavaScript> which provides the last update time as a JavaScript timestamp - which is always in UTC.

Re: [Request] Webtag to Provide Times in UTC

Posted: Thu 09 Jul 2020 9:25 am
by sfws
mcrossley wrote: Thu 09 Jul 2020 7:48 am There is also <#timeJavaScript> which provides the last update time as a JavaScript timestamp - which is always in UTC.
Thank you, Mark, I forgot you had added that from version 3.5.2!
Oh dear, yet another web tag added by MX that nobody added to the Wiki list of web tags. Now I have added <#timeJavaScript> and <#RecentFeelsLike>.

That web tag is a much more appropriate answer given original question
buffaloseven wrote: Thu 09 Jul 2020 1:29 am particularly as Javascript doesn't really support time zones that well,

Re: [Request] Webtag to Provide Times in UTC

Posted: Thu 09 Jul 2020 12:09 pm
by buffaloseven
Well, I'll be. I had no idea these two web tags existed and somehow never came across them in the Wiki. They're perfect! Thanks for pointing them out! And you're right, #timeJavaScript will be perfect for my needs. Thanks so much!

Re: [Request] Webtag to Provide Times in UTC

Posted: Fri 10 Jul 2020 4:46 am
by buffaloseven
Alright! I had some time to play with it tonight and realized two things:

1. I should have been more specific and left out an important point and should have been more clear: I would like to see time output (not format) in UTC in a webtag that functions like the <#RecentTS> tag. The <#timeUTC> and <#timeJavaScript> only output the current time, assuming I'm reading right and experimenting correctly.
2. I had forgotten about the 'zzz' specifier for use with formatting the time output (I have no idea how I missed that one). It has certainly helped. That said, it would still be nice to output the time in UTC rather than the local time zone when using a webtag that functions like <#RecentTS>.

Hopefully that clarifies things a bit! Sorry for my original ambiguity.