<p></p>
<blockquote>
<p>%T is documented in the <a href="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=msvc-160" rel="nofollow">MS version</a> of strftime() but <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/eht16/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eht16">@eht16</a> is that used, or is some msys2 version of strftime() used?</p>
</blockquote>
<p>I think MSVCRT is used, i.e. one of the Windows C runtimes. It seems nowadays, there is MSVCRT and UCRT which seems to be a newer implementation of the C runtime on Windows (and only available since Windows 10).<br>
I found <a href="https://www.msys2.org/docs/environments/" rel="nofollow">https://www.msys2.org/docs/environments/</a> and <a href="https://sourceforge.net/p/mingw-w64/bugs/793/" rel="nofollow">https://sourceforge.net/p/mingw-w64/bugs/793/</a>. Possibly MSVCRT does not support <code>%T</code> while UCRT does.</p>
<blockquote>
<p>Replacing %T with %H:%M:%S works interestingly enough, which gets around the problem in the original post.</p>
<p>However a new problem emerges, the Windows version is interpreting %z as %Z (in fact they do the same on Windows). On Linux %z correctly gives the numeric offset from UTC, and %Z gives an abbreviated version of the timezone name. It wouldn't be so bad, but the Windows version isn't abbreviated, you get a whole sentence :(</p>
</blockquote>
<p>Wow, yes, could reproduce.</p>
<p>I wrote a simple <a href="https://gist.github.com/eht16/757cc4e814da41a9e8d7a8fba443232f">test program</a> to better see the differences between Linux (glibc) and Windows (MSVCRT).<br>
The results:</p>
<pre><code>Windows:

Format: %a, %d %b %Y %T %z:
CRT : Error: Invalid argument
GLib: Sun, 07 Nov 2021 23:18:31 +0100

Format: %a, %d %b %Y %T %Z:
CRT : Error: Invalid argument
GLib: Sun, 07 Nov 2021 23:18:31 W. Europe Standard Time

Format: %a, %d %b %Y %H:%M:%S %z:
CRT : Sun, 07 Nov 2021 23:18:31 W. Europe Standard Time
GLib: Sun, 07 Nov 2021 23:18:31 +0100

Format: %a, %d %b %Y %H:%M:%S %Z:
CRT : Sun, 07 Nov 2021 23:18:31 W. Europe Standard Time
GLib: Sun, 07 Nov 2021 23:18:31 W. Europe Standard Time


Linux:

Format: %a, %d %b %Y %T %z:
CRT : Sun, 07 Nov 2021 23:14:31 +0100
GLib: Sun, 07 Nov 2021 23:14:31 +0100

Format: %a, %d %b %Y %T %Z:
CRT : Sun, 07 Nov 2021 23:14:31 CET
GLib: Sun, 07 Nov 2021 23:14:31 CET

Format: %a, %d %b %Y %H:%M:%S %z:
CRT : Sun, 07 Nov 2021 23:14:31 +0100
GLib: Sun, 07 Nov 2021 23:14:31 +0100

Format: %a, %d %b %Y %H:%M:%S %Z:
CRT : Sun, 07 Nov 2021 23:14:31 CET
GLib: Sun, 07 Nov 2021 23:14:31 CET
</code></pre>
<p>The <a href="https://docs.gtk.org/glib/struct.DateTime.html" rel="nofollow">GLib DateTime API</a> seems to work better and supports <code>%T</code> as well as the expected <code>%z</code> and <code>%Z</code> behaviour.</p>
<p>However, it have other limitations ("The format strings understood by this function are a subset of the strftime() format language") on <a href="https://docs.gtk.org/glib/method.DateTime.format.html" rel="nofollow">https://docs.gtk.org/glib/method.DateTime.format.html</a>. However, I have difficulties to understand what exactly is supported and what not, also because the formatting seems broken on that page.</p>
<p>Switching to GLib DateTime API should be fairly easy, I'm only wondering if this might break other format specfifiers.</p>
<p>Windows is so much fun...</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2968#issuecomment-962701444">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJYIH7SXKN7KBOG3ASLUK4DFDANCNFSM5G32I3ZA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJYVC36FW7SRRT6W3FLUK4DFDA5CNFSM5G32I3ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHFQ2RBA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2968#issuecomment-962701444",
"url": "https://github.com/geany/geany/issues/2968#issuecomment-962701444",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>