mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-04-17 22:17:00 +02:00
More date/time processing fixes (Issue #115)
This commit is contained in:
parent
cbea3ecc2a
commit
7afefda326
@ -860,18 +860,19 @@ get_date_time(const char *s) // I - PDF date/time value
|
|||||||
#if _WIN32
|
#if _WIN32
|
||||||
if ((t = _mkgmtime(&dateval)) <= 0)
|
if ((t = _mkgmtime(&dateval)) <= 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
#elif defined(HAVE_TIMEGM)
|
#elif defined(HAVE_TIMEGM)
|
||||||
if ((t = timegm(&dateval)) <= 0)
|
if ((t = timegm(&dateval)) <= 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if ((t = mktime(&dateval)) <= 0)
|
if ((t = mktime(&dateval)) <= 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
# if defined(HAVE_TM_GMTOFF)
|
# if defined(HAVE_TM_GMTOFF)
|
||||||
localtime_r(&t, &dateval);
|
t += dateval.tm_gmtoff - 3600 * dateval.tm_isdst;
|
||||||
t -= dateval.tm_gmtoff;
|
|
||||||
# else
|
# else
|
||||||
t -= timezone;
|
t += timezone - 3600 * dateval.tm_isdst;
|
||||||
# endif // HAVE_TM_GMTOFF
|
# endif // HAVE_TM_GMTOFF
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user