I’m trying to use the value of created and modified field in the datetime HTML attribute, like so:
<time datetime="YYYY-MM-DDTHH:MMZ">local time format her</time>
The W3C states that the value of the datetime attribute should always be in UTC (Zulu) as it is read by machines and they do the conversion. While the human-facing time is the one between <time></time>.
As shown in the screenshot, the format:date is giving the local time. It matches my desktop clock as well as the other ways to output the time via TiddlyWiki. While the one with a [UTC] prefix outputs the correct UTC time.
Is it a bug since it’s no longer giving a UTC value? Or, was it changed? In any case, is there a way to set [UTC]?
While testing this code, I found that Firefox on linux doesn’t give the expected result for the ViewWidget, but instead displays modified field as UTC.
It might be related to my configuration where my hardware clock is set as UTC and system time is set as local time.
Anyway, the same code works normally on the same machine with Vivaldi browser.
This code based on a text widget behaves the same as the view widget on my machine (UTC on Firefox, Ok on Vivaldi):
the INPUT for the format:date[...] filter is always assumed to be UTC
But your observation (“it’s no longer giving a UTC value”) is about the OUTPUT of the format:date[...] filter, which automatically converts the output to your local time zone, unless the format has a [UTC] prefix. Thus, it is NOT a bug, and hasn’t changed.
So to be clear modified and created dates are already in UTC so if you want to see them as UTC you need to make sure they are not converted to local time as they are by default.
I eventually found the cause of this weird behavior: it’s a consequence of Firefox’s “Resist Fingerprinting” setting, which makes times appear in the wrong timezones.
Source: https://support.mozilla.org/en-US/kb/resist-fingerprinting