def DateTime.of_instant
import bend-kit-time@0.3.0.0/time.bend as Timeimport Base
import bend-kit-int@0.2.0.0/int.bend as Int
295# The UTC date and time of i, or None outside years 0 to 9999.
296def DateTime.of_instant(i: Instant) -> Maybe<&2, DateTime>:
297 match i:
298 case Instant{+s, n}:
299 +r = Int.I64.mod(s, i64(86400))
300 DateTime.floor(Int.I64.is_neg(r), Int.I64.div(s, i64(86400)), r, n)