summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--time.c8
-rw-r--r--txr.12
2 files changed, 5 insertions, 5 deletions
diff --git a/time.c b/time.c
index b53fa37f..fbc1d42c 100644
--- a/time.c
+++ b/time.c
@@ -438,7 +438,7 @@ static val time_meth(val utc_p, val time_struct)
hour, min, sec, dst);
if (gmtoff)
- out = plus(out, gmtoff);
+ out = minus(out, gmtoff);
return out;
}
@@ -501,7 +501,7 @@ val time_parse_local(val format, val string)
#if HAVE_TM_GMTOFF
{
long gmtoff = tms.TM_GMTOFF;
- return num(mktime(&tms) + gmtoff);
+ return num(mktime(&tms) - gmtoff);
}
#else
return num(mktime(&tms));
@@ -516,12 +516,12 @@ val time_parse_utc(val format, val string)
#if HAVE_TIMEGM && HAVE_TM_GMTOFF
{
long gmtoff = tms.TM_GMTOFF;
- return num_time(timegm(&tms) + gmtoff);
+ return num_time(timegm(&tms) - gmtoff);
}
#elif HAVE_TM_GMTOFF
{
long gmtoff = tms.TM_GMTOFF;
- return num_time(timegm_hack(&tms) + tms.gmtoff);
+ return num_time(timegm_hack(&tms) - tms.gmtoff);
}
#elif HAVE_TIMEGM
return num_time(timegm(&tms));
diff --git a/txr.1 b/txr.1
index 38172b93..f5a409b5 100644
--- a/txr.1
+++ b/txr.1
@@ -69054,7 +69054,7 @@ Note: if the
.code gmtoff
slot is not
.codn nil ,
-its value is added to the returned result.
+its value is subtracted from the returned result.
.coNP Method @ time-string
.synb