obspy.core.utcdatetime.UTCDateTime.isocalendar

UTCDateTime.isocalendar()[source]

Returns a tuple containing (ISO year, ISO week number, ISO weekday).

Return type:

tuple(int)

Returns:

Returns a (named) tuple containing ISO year, ISO week number and ISO weekday. Depending on the used Python version it either returns a tuple (Py<3.9) or named tuple (Py>=3.9).

Example

>>> dt = UTCDateTime(2008, 10, 1, 12, 30, 35, 45020)
>>> tuple(dt.isocalendar())
(2008, 40, 3)