Use a reliable source for TZ offset

Both the POSIX and Linux man pages for localtime_r() state that
  localtime_r need not set the global variable timezone. I found
  that '\set_clock local' was using an offset of -0500 instead of
  -0400 (EDT). Change date_strget to use tm_gmtoff.
This commit is contained in:
George Baltz N3GB 2024-09-10 04:54:57 -04:00
parent b667e31dcf
commit 5f6554c797

View File

@ -2834,7 +2834,7 @@ char *date_strget(char *buf, int buflen, int localtime)
if (localtime)
{
mytm = localtime_r(&t, &result);
mytimezone = timezone;
mytimezone = - (int)result.tm_gmtoff;
}
else
{