def tz.rule.offset

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

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

1012def tz.rule.offset(standard: Ttype, abbr: String, west: Int.I64, rest: String) -> Maybe<&2, TzRule>:
1013  match rest:
1014    case SCon{Chr{44}, t}:
1015      tz.rule.dates(standard, Ttype{Int.I64.sub(i64(3600), west), True{}, abbr}, rest)
1016    # POSIX leaves absent DST dates to the implementation; use the common US rules.
1017    case SNil{}:
1018      tz.rule.end(True{}, standard, Ttype{Int.I64.sub(i64(3600), west), True{}, abbr},
1019        TzDate{MonthWeek{3, 2, 0}, i64(7200)}, TzDate{MonthWeek{11, 1, 0}, i64(7200)})
1020    case _:
1021      do Maybe<&2, TzRule>:
1022        r : TzClock <- tz.clock.sign(rest, 24)
1023        tz.rule.dstclock(r, standard, abbr)

Uses (20)

Used by (1)