getTimeZoneTransition
Returns the first instant after or before this instant at which the time zone's UTC offset changes, or null if none.
Parameters
- self:ZonedDateTime
- ZonedDateTime
- direction:enum { next, previous }
- enum { next, previous }
Source
Implementation
pub fn getTimeZoneTransition(self: ZonedDateTime, direction: enum { next, previous }) !?ZonedDateTime {
const dir = switch (direction) {
.next => abi.c.TransitionDirection_Next,
.previous => abi.c.TransitionDirection_Previous,
};
const result = abi.c.temporal_rs_ZonedDateTime_get_time_zone_transition(self._inner, @intCast(dir));
const maybe_ptr = try abi.extractResult(result);
if (maybe_ptr) |ptr| {
return .{ ._inner = ptr };
}
return null;
}