diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2002-05-22 00:57:24 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2002-05-22 00:57:24 +0000 |
commit | edc904ae56e461d9ac84f31320f2317d3af6a011 (patch) | |
tree | 9be3b2cd88e6321d0417156bbaa70042e7f028a7 /time/win32 | |
parent | cf4ba38a69efdd6e78f82e7daeae17293504fec7 (diff) | |
download | apr-edc904ae56e461d9ac84f31320f2317d3af6a011.tar.gz |
Fix two serious holes in the time calculations. The first patch was a
discrepancy with the Unix implementations. The second patch applies
to Unix implementations, no? gmtoff is independent of isdst, since
gmtoff must be relocatable to another calendar month when dst is
in it's other state [on/off boolean.]
Reported by: Jon Travis <jtravis@covalent.net>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63422 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time/win32')
-rw-r--r-- | time/win32/time.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/time/win32/time.c b/time/win32/time.c index e188b8a4a..d8b0c4cf3 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -215,7 +215,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, if (days < 0) { return APR_EBADDATE; } - days -= xt->tm_gmtoff; *t = days * APR_USEC_PER_SEC + xt->tm_usec; return APR_SUCCESS; } @@ -225,7 +224,8 @@ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, { apr_status_t status = apr_time_exp_get(t, xt); if (status == APR_SUCCESS) - *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; + *t -= (apr_time_t) (xt->tm_isdst * 3600 + + xt->tm_gmtoff) * APR_USEC_PER_SEC; return status; } |