def rfc3339.shift

bend-kit-time@0.3.0.0 · time.bend:536

import bend-kit-time@0.3.0.0/time.bend as Time
import Base

536def rfc3339.shift(m: Maybe<&2, Instant>, +west: U32, +hh: U32, +mm: U32) -> Maybe<&2, Instant>:
537  match m:
538    case None{}:
539      None{}
540    case Some{i}:
541      +off = Duration.of_secs(i64((hh * 3600 + mm * 60 : U32)))
542      Bool.pick(Maybe<&2, Instant>, Bool.and(U32.is_le(hh, 23), U32.is_le(mm, 59)),
543        Some{Instant.add(i, Bool.pick(Duration, U32.is_eq(west, 1), off, Duration.neg(off)))}, None{})

Uses (14)

Used by (1)