@@ -254,6 +254,22 @@ cdef class _Timestamp(ABCTimestamp):
254
254
"""
255
255
The abbreviation associated with self._creso.
256
256
257
+ This property returns a string representing the time unit of the Timestamp's
258
+ resolution. It corresponds to the smallest time unit that can be represented
259
+ by this Timestamp object. The possible values are 's' (second ), 'ms' (millisecond ),
260
+ 'us' (microsecond ), and 'ns' (nanosecond ).
261
+
262
+ Returns
263
+ -------
264
+ str
265
+ A string abbreviation of the Timestamp's resolution unit:
266
+ 's' for second , 'ms' for millisecond , 'us' for microsecond , or 'ns' for nanosecond.
267
+
268
+ See Also
269
+ --------
270
+ Timestamp.resolution : Return resolution of the Timestamp.
271
+ Timedelta : A duration expressing the difference between two dates or times.
272
+
257
273
Examples
258
274
--------
259
275
>>> pd.Timestamp("2020-01-01 12:34:56").unit
@@ -1771,6 +1787,21 @@ class Timestamp(_Timestamp):
1771
1787
"""
1772
1788
Return utc offset.
1773
1789
1790
+ This method returns the difference between UTC and the local time
1791
+ as a `timedelta` object. It is useful for understanding the time
1792
+ difference between the current timezone and UTC.
1793
+
1794
+ Returns
1795
+ --------
1796
+ timedelta
1797
+ The difference between UTC and the local time as a `timedelta` object.
1798
+
1799
+ See Also
1800
+ --------
1801
+ datetime.datetime.utcoffset : Standard library method to get the UTC offset of a datetime object.
1802
+ Timestamp.tzname : Return the name of the timezone.
1803
+ Timestamp.dst : Return the daylight saving time (DST) adjustment.
1804
+
1774
1805
Examples
1775
1806
--------
1776
1807
>>> ts = pd.Timestamp('2023-01-01 10:00:00', tz='Europe/Brussels')
@@ -1783,7 +1814,23 @@ class Timestamp(_Timestamp):
1783
1814
1784
1815
def utctimetuple (self ):
1785
1816
"""
1786
- Return UTC time tuple, compatible with time.localtime().
1817
+ Return UTC time tuple, compatible with `time.localtime()`.
1818
+
1819
+ This method converts the Timestamp to UTC and returns a time tuple
1820
+ containing 9 components: year, month, day, hour, minute, second,
1821
+ weekday, day of year, and DST flag. This is particularly useful for
1822
+ converting a Timestamp to a format compatible with time module functions.
1823
+
1824
+ Returns
1825
+ -------
1826
+ time.struct_time
1827
+ A time.struct_time object representing the UTC time.
1828
+
1829
+ See Also
1830
+ --------
1831
+ datetime.datetime.utctimetuple : Return UTC time tuple, compatible with time.localtime().
1832
+ Timestamp.timetuple : Return time tuple of local time.
1833
+ time.struct_time : Time tuple structure used by time functions.
1787
1834
1788
1835
Examples
1789
1836
--------
0 commit comments