summaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-05-22 00:57:24 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-05-22 00:57:24 +0000
commit6ba758ffab9343278fe872be6b64597d08177952 (patch)
tree9be3b2cd88e6321d0417156bbaa70042e7f028a7 /time
parentd016986c9b0e563345d05269fb509441159565f8 (diff)
downloadlibapr-6ba758ffab9343278fe872be6b64597d08177952.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: http://svn.apache.org/repos/asf/apr/apr/trunk@63422 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time')
-rw-r--r--time/win32/time.c4
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;
}