TimeZone(name)
Source¶
A time zone of the IANA database, such as "Europe/Paris" or "UTC", used by TimeZoneChange.
A zone follows the summer and winter time changes of its place. Fixed offsets such as "+01:00"
are not time zones.
Added in version 0.1.0
Parameters:
-
name(str)The IANA name of the zone.
Raises:
-
InvalidTypeErrorWhen a setting is not of the type its annotation names.
-
UnknownTimeZoneErrorWhen the name is not a known IANA name.
Examples:
from datetime import datetime
import numdaplot as ndp
times = ndp.Table.from_arrays({"time": ndp.Array.from_list([datetime(2026, 7, 1, 10, 30)])})
paris = ndp.TimeZone("Europe/Paris")
in_paris = ndp.TimeZoneChange(mode=ndp.TimeZoneMode.ATTRIBUTE, zone=paris)
paris_times = times.convert(ndp.TableConversion(columns=["time"], dtype=ndp.Type.DATETIME, timezone=in_paris))
paris_times.column_time_zones
# {'time': TimeZone(name='Europe/Paris')}