pyoda_time.testing.time_zones package¶
Module contents¶
- class pyoda_time.testing.time_zones.SingleTransitionDateTimeZone¶
Bases:
DateTimeZoneTime zone with a single transition between two offsets.
This provides a simple way to test behaviour across a transition.
- class property utc: DateTimeZone¶
Gets the UTC (Coordinated Universal Time) time zone.
This is a single instance which is not provider-specific; it is guaranteed to have the ID “UTC”, and to compare equal to an instance returned by calling
for_offsetwith an offset of zero, but it may or may not compare equal to an instance returned by e.g.DateTimeZoneProviders.Tzdb["UTC"].- Returns:
The UTC
DateTimeZone.
- __init__(transition_point: Instant, offset_before: Offset | int, offset_after: Offset | int, id_: str = 'Single') None¶
Creates a zone with a single transition between two offsets.
- Parameters:
transition_point – The transition point as an
Instant.offset_before – The offset of local time from UTC before the transition.
offset_after – The offset of local time from UTC before the transition.
id
- property early_interval: ZoneInterval¶
Gets the
ZoneIntervalfor the period before the transition, starting at the beginning of time.- Returns:
The zone interval for the period before the transition, starting at the beginning of time.
- get_zone_interval(instant: Instant) ZoneInterval¶
- property late_interval: ZoneInterval¶
Gets the
ZoneIntervalfor the period after the transition, ending at the end of time.- Returns:
The zone interval for the period after the transition, ending at the end of time.