Skip to content

Commit a471f00

Browse files
committed
Added docstring to Timestamp.tzinfo
1 parent 8943c97 commit a471f00

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pandas/_libs/tslibs/timestamps.pyx

+22
Original file line numberDiff line numberDiff line change
@@ -2977,6 +2977,28 @@ timedelta}, default 'raise'
29772977
"""
29782978
return self.tzinfo
29792979
2980+
@property
2981+
def tzinfo(self):
2982+
"""
2983+
Returns the timezone information of the Timestamp.
2984+
2985+
For pandas-specific timezone operations, the `tz` property is the
2986+
recommended interface.
2987+
2988+
See Also
2989+
--------
2990+
Timestamp.tz : Alias for tzinfo.
2991+
Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
2992+
Timestamp.tz_localize : Localize the Timestamp to a timezone.
2993+
2994+
Examples
2995+
--------
2996+
>>> ts = pd.Timestamp(1584226800, unit='s', tz='Europe/Stockholm')
2997+
>>> ts.tzinfo
2998+
zoneinfo.ZoneInfo(key='Europe/Stockholm')
2999+
"""
3000+
return self.tzinfo
3001+
29803002
@tz.setter
29813003
def tz(self, value):
29823004
# GH 3746: Prevent localizing or converting the index by setting tz

0 commit comments

Comments
 (0)