@@ -144,6 +144,7 @@ def ints_to_pydatetime(ndarray[int64_t] arr, tz=None, freq=None, box=False):
144
144
145
145
cdef:
146
146
Py_ssize_t i, n = len (arr)
147
+ ndarray[int64_t] trans, deltas
147
148
pandas_datetimestruct dts
148
149
object dt
149
150
int64_t value
@@ -707,8 +708,7 @@ class Timestamp(_Timestamp):
707
708
value = self .value
708
709
if _tzinfo is not None :
709
710
value_tz = tz_convert_single(value, _tzinfo, ' UTC' )
710
- offset = value - value_tz
711
- value += offset
711
+ value += value - value_tz
712
712
713
713
# setup components
714
714
pandas_datetime_to_datetimestruct(value, PANDAS_FR_ns, & dts)
@@ -1641,6 +1641,10 @@ cdef inline void _localize_tso(_TSObject obj, object tz):
1641
1641
"""
1642
1642
Take a TSObject in UTC and localizes to timezone tz.
1643
1643
"""
1644
+ cdef:
1645
+ ndarray[int64_t] trans, deltas
1646
+ Py_ssize_t delta, posn
1647
+
1644
1648
if _is_utc(tz):
1645
1649
obj.tzinfo = tz
1646
1650
elif _is_tzlocal(tz):
@@ -4174,7 +4178,7 @@ def tz_convert(ndarray[int64_t] vals, object tz1, object tz2):
4174
4178
return result
4175
4179
4176
4180
4177
- def tz_convert_single (int64_t val , object tz1 , object tz2 ):
4181
+ cpdef int64_t tz_convert_single(int64_t val, object tz1, object tz2):
4178
4182
"""
4179
4183
Convert the val (in i8) from timezone1 to timezone2
4180
4184
@@ -5178,6 +5182,7 @@ cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts) nogil:
5178
5182
def dates_normalized (ndarray[int64_t] stamps , tz = None ):
5179
5183
cdef:
5180
5184
Py_ssize_t i, n = len (stamps)
5185
+ ndarray[int64_t] trans, deltas
5181
5186
pandas_datetimestruct dts
5182
5187
5183
5188
if tz is None or _is_utc(tz):
0 commit comments