summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_datetimemodule.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 149f573..6df5c03 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -4717,12 +4717,8 @@ local_timezone(PyDateTime_DateTime *utc_time)
return NULL;
timep = localtime(&timestamp);
#ifdef HAVE_STRUCT_TM_TM_ZONE
- {
- long offset;
- offset = timep->tm_gmtoff;
- zone = timep->tm_zone;
- delta = new_delta(0, -offset, 0, 0);
- }
+ zone = timep->tm_zone;
+ delta = new_delta(0, timep->tm_gmtoff, 0, 1);
#else /* HAVE_STRUCT_TM_TM_ZONE */
{
PyObject *local_time;
@@ -4732,7 +4728,7 @@ local_timezone(PyDateTime_DateTime *utc_time)
utc_time->tzinfo);
if (local_time == NULL)
goto error;
- delta = datetime_subtract((PyObject*)utc_time, local_time);
+ delta = datetime_subtract(local_time, (PyObject*)utc_time);
/* XXX: before relying on tzname, we should compare delta
to the offset implied by timezone/altzone */
if (daylight && timep->tm_isdst >= 0)