pandas.Timestamp.timetuple#

Timestamp.timetuple()#

Return time tuple, compatible with time.localtime().

This method converts the Timestamp into a time tuple, which is compatible with functions like time.localtime(). The time tuple is a named tuple with attributes such as year, month, day, hour, minute, second, weekday, day of the year, and daylight savings indicator.

See also

time.localtime

Converts a POSIX timestamp into a time tuple.

Timestamp

The Timestamp that represents a specific point in time.

datetime.datetime.timetuple

Equivalent method in the datetime module.

Examples

>>> ts = pd.Timestamp('2023-01-01 10:00:00')
>>> ts
Timestamp('2023-01-01 10:00:00')
>>> ts.timetuple()
time.struct_time(tm_year=2023, tm_mon=1, tm_mday=1,
tm_hour=10, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=1, tm_isdst=-1)