Skip to content

Commit 322178c

Browse files
committed
CLN: add comment to solution and move to v1.1.0
1 parent 5053889 commit 322178c

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

doc/source/whatsnew/v1.0.0.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,6 @@ Datetimelike
968968
- Bug in :func:`date_range` with custom business hours as ``freq`` and given number of ``periods`` (:issue:`30593`)
969969
- Bug in :class:`PeriodIndex` comparisons with incorrectly casting integers to :class:`Period` objects, inconsistent with the :class:`Period` comparison behavior (:issue:`30722`)
970970
- Bug in :meth:`DatetimeIndex.insert` raising a ``ValueError`` instead of a ``TypeError`` when trying to insert a timezone-aware :class:`Timestamp` into a timezone-naive :class:`DatetimeIndex`, or vice-versa (:issue:`30806`)
971-
- Bug in :class:`Timestamp` where constructing :class:`Timestamp` from ambiguous epoch time and calling constructor again changed :meth:`Timestamp.value` property (:issue:`24329`)
972971

973972
Timedelta
974973
^^^^^^^^^

doc/source/whatsnew/v1.1.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Categorical
5959

6060
Datetimelike
6161
^^^^^^^^^^^^
62+
- Bug in :class:`Timestamp` where constructing :class:`Timestamp` from ambiguous epoch time and calling constructor again changed :meth:`Timestamp.value` property (:issue:`24329`)
6263
-
6364
-
6465

pandas/_libs/tslibs/conversion.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ cdef _TSObject convert_datetime_to_tsobject(datetime ts, object tz,
363363
else:
364364
obj.value = pydatetime_to_dt64(ts, &obj.dts)
365365
# GH 24329 Take DST offset into account
366+
# pydatetime_to_dt64 doesn't take DST into account
367+
# but get_utcoffset does. dateutil assumes DST
368+
# when time is ambiguous, so we need to correct for it
366369
if treat_tz_as_dateutil(ts.tzinfo):
367370
if ts.tzinfo.is_ambiguous(ts):
368371
dst_offset = ts.tzinfo.dst(ts)

0 commit comments

Comments
 (0)