More date/time processing fixes (Issue #115)

This commit is contained in:
Michael R Sweet 2025-04-06 12:10:55 -04:00
parent cbea3ecc2a
commit 7afefda326
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244

View File

@ -860,18 +860,19 @@ get_date_time(const char *s) // I - PDF date/time value
#if _WIN32
if ((t = _mkgmtime(&dateval)) <= 0)
return (0);
#elif defined(HAVE_TIMEGM)
if ((t = timegm(&dateval)) <= 0)
return (0);
#else
if ((t = mktime(&dateval)) <= 0)
return (0);
# if defined(HAVE_TM_GMTOFF)
localtime_r(&t, &dateval);
t -= dateval.tm_gmtoff;
t += dateval.tm_gmtoff - 3600 * dateval.tm_isdst;
# else
t -= timezone;
t += timezone - 3600 * dateval.tm_isdst;
# endif // HAVE_TM_GMTOFF
#endif // _WIN32