tzoffset
Return UTC offsets for timezone-aware datetime values.
📝Syntax
d = tzoffset(t)
📥Input Arguments
Parameter Description
inputs A datetime array whose TimeZone property is empty, a fixed offset, local, or a supported timezone name.
📤Output Arguments
Parameter Description
output A duration array containing offsets from UTC.
📄Description

Return UTC offsets for timezone-aware datetime values.

Named timezone offsets are read from the embedded timezone data. Fixed offsets such as +02:30 are parsed directly.

Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.

💡Examples
Basic usage.
tzoffset(datetime(2024, 7, 1, 'TimeZone', 'Europe/Paris'))
tzoffset(datetime(2024, 1, 1, 'TimeZone', '+02:30'))
🔗See Also
datetimeduration
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub