on 492ae2f help sign in
44 lines 946 B history raw
1### `++deal`
3Add leap seconds
5Produces a [`++date`]() with the 25 leap seconds added.
7Accepts
8-------
10`yer` is an absolute date, [`@da`]().
12Produces
13--------
15A `++date`.
17Source
18------
20 ++ deal :: to leap sec time
21 |= yer=@da
22 =+ n=0
23 =+ yud=(yore yer)
24 |- ^- date
25 ?: (gte yer (add (snag n lef:yu) ~s1))
26 (yore (year yud(s.t (add n s.t.yud))))
27 ?: &((gte yer (snag n lef:yu)) (lth yer (add (snag n lef:yu) ~s1)))
28 yud(s.t (add +(n) s.t.yud))
29 ?: =(+(n) (lent lef:yu))
30 (yore (year yud(s.t (add +(n) s.t.yud))))
31 $(n +(n))
32 ::
34Examples
35--------
37 ~zod/try=> (yore (bex 127))
38 [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=8 f=~]]
39 ~zod/try=> (deal `@da`(bex 127))
40 [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=33 f=~]]
41 ~zod/try=> (yore (bex 126))
42 [[a=%.n y=146.138.512.088] m=6 t=[d=19 h=7 m=45 s=4 f=~]]