pandas.Timestamp.utctimetuple#

Timestamp.utctimetuple()#

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

This method converts the Timestamp to UTC and returns a time tuple containing 9 components: year, month, day, hour, minute, second, weekday, day of year, and DST flag. This is particularly useful for converting a Timestamp to a format compatible with time module functions.

Returns:
time.struct_time

A time.struct_time object representing the UTC time.

See also

datetime.datetime.utctimetuple

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

Timestamp.timetuple

Return time tuple of local time.

time.struct_time

Time tuple structure used by time functions.

Examples

>>> ts = pd.Timestamp('2023-01-01 10:00:00', tz='Europe/Brussels')
>>> ts
Timestamp('2023-01-01 10:00:00+0100', tz='Europe/Brussels')
>>> ts.utctimetuple()
time.struct_time(tm_year=2023, tm_mon=1, tm_mday=1, tm_hour=9,
tm_min=0, tm_sec=0, tm_wday=6, tm_yday=1, tm_isdst=0)