def DateTime.floor

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

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

287# r is secs % 86400, which has the sign of secs.
288def DateTime.floor(neg: Bool, q: Int.I64, r: Int.I64, n: U32) -> Maybe<&2, DateTime>:
289  match neg:
290    case True{}:
291      DateTime.at(Date.of_days(Int.I64.sub(q, i64(1))), (Int.I64.to_u32(r) + 86400 : U32), n)
292    case False{}:
293      DateTime.at(Date.of_days(q), Int.I64.to_u32(r), n)

Uses (11)

Used by (1)