File tree 2 files changed +28
-1
lines changed
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
75
75
-i " pandas.Timestamp.max PR02" \
76
76
-i " pandas.Timestamp.min PR02" \
77
77
-i " pandas.Timestamp.resolution PR02" \
78
- -i " pandas.Timestamp.tzinfo GL08" \
79
78
-i " pandas.core.groupby.DataFrameGroupBy.plot PR02" \
80
79
-i " pandas.core.groupby.SeriesGroupBy.plot PR02" \
81
80
-i " pandas.core.resample.Resampler.quantile PR01,PR07" \
Original file line number Diff line number Diff line change @@ -2208,6 +2208,34 @@ class Timestamp(_Timestamp):
2208
2208
"""
2209
2209
return super().tzname()
2210
2210
2211
+ @property
2212
+ def tzinfo(self):
2213
+ """
2214
+ Returns the timezone info of the Timestamp.
2215
+
2216
+ This property returns a `datetime.tzinfo` object if the Timestamp
2217
+ is timezone- aware. If the Timestamp has no timezone, it returns `None `.
2218
+ If the Timestamp is in UTC or a fixed- offset timezone,
2219
+ it returns `datetime.timezone`. If the Timestamp uses an
2220
+ IANA timezone (e.g., " America/New_York" ), it returns `zoneinfo.ZoneInfo`.
2221
+
2222
+ See Also
2223
+ --------
2224
+ Timestamp.tz : Alias for `tzinfo`, may return a `zoneinfo.ZoneInfo` object .
2225
+ Timestamp.tz_convert : Convert timezone- aware Timestamp to another time zone.
2226
+ Timestamp.tz_localize : Localize the Timestamp to a specific timezone.
2227
+
2228
+ Examples
2229
+ --------
2230
+ >>> ts = pd.Timestamp(" 2023-01-01 12:00:00" , tz = " UTC" )
2231
+ >>> ts.tzinfo
2232
+ datetime.timezone.utc
2233
+
2234
+ >>> ts_naive = pd.Timestamp(" 2023-01-01 12:00:00" )
2235
+ >>> ts_naive.tzinfo
2236
+ """
2237
+ return super().tzinfo
2238
+
2211
2239
def utcoffset(self):
2212
2240
"""
2213
2241
Return utc offset.
You can’t perform that action at this time.
0 commit comments