Skip to main content

step_time_field

Function step_time_field 

Source
pub fn step_time_field(time: Time, kind: SegmentKind, delta: i32) -> Time
Expand description

Step a single field of a Time by delta. Hour wraps in [0, 24) (whether 12h or 24h segment kind — internal storage is 24h). Minute and second wrap in [0, 60). AM/PM toggles on any non-zero delta (sign-agnostic). Returns the input time unchanged when kind is not a time field.