4 ++ yo :: time constants core
6Useful constants for interacting with earth time.
10Days in a century. Derived by multiplying the number of days in a year
11(365) by the number of years in a century (100), then adding the number
12days from leap years in a century (24).
22 |% ++ cet 36.524 :: (add 24 (mul 100 365))
31 > (sub (add 24 (mul 100 365)) cet:yo)
34------------------------------------------------------------------------
38Number of seconds in a day.
48 ++ day 86.400 :: (mul 24 hor)
58------------------------------------------------------------------------
72 ++ era 146.097 :: (add 1 (mul 4 cet))
78------------------------------------------------------------------------
84The number of seconds in an hour. Derived by multiplying the number of
85seconds in a minute by the minutes in an hour.
95 ++ hor 3.600 :: (mul 60 mit)
105------------------------------------------------------------------------
119 ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
127------------------------------------------------------------------------
133The number of seconds in a minute.
151------------------------------------------------------------------------
157The days in each month of the Gregorian common year. A list of unsigned
158decimal atoms (Either 28, 30, or 31) denoting the number of days in the
159month at the year at that index.
169 ++ moh `(list @ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
175 ~[31 28 31 30 31 30 31 31 30 31 30 31]
179------------------------------------------------------------------------
185The days in each month of the Gregorian leap-year. A list of unsigned
186decimal atoms (Either 29,30, or 31) denoting the number of days in the
187month at the leap-year at that index.
197 ++ moy `(list @ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
203 ~[31 29 31 30 31 30 31 31 30 31 30 31]
207------------------------------------------------------------------------
213The number of seconds in four years. Derived by adding one second to the
214number of seconds in four years.
224 ++ qad 126.144.001 :: (add 1 (mul 4 yer))
232------------------------------------------------------------------------
238The number of seconds in a year. Derived by multiplying the number of
239seconds in a day by 365.
249 ++ yer 31.536.000 :: (mul 365 day)
262Time since beginning of time
264Produce the date tuple of `[y=@ud m=@ud d=@ud]` of the year, month, and
265day from a number of days from the beginning of time.
279 ++ yall :: day / to day of year
281 ^- {y/@ud m/@ud d/@ud}
282 =+ [era=0 cet=0 lep=*?]
283 => .(era (div day era:yo), day (mod day era:yo))
285 ?: (lth day +(cet:yo))
287 => .(lep |, cet 1, day (sub day +(cet:yo)))
288 .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
289 =+ yer=(add (mul 400 era) (mul 100 cet))
290 |- ^- {y/@ud m/@ud d/@ud}
291 =+ dis=?:(lep 366 365)
294 $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
295 |- ^- {y/@ud m/@ud d/@ud}
296 =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
297 |- ^- {y/@ud m/@ud d/@ud}
298 =+ zis=(snag mot cah)
301 $(mot +(mot), day (sub day zis))
319Days since beginning of time
321Inverse of `yall`, computes number of days A.D. from y/m/d date as the
322tuple `[yer=@ud mot=@ud day=@ud]`.
327`yer` is an unsigned decimal, `@ud`.
329`mon` is an unsigned decimal, `@ud`.
331`day` is an unsigned decimal, `@ud`.
341 ++ yawn :: days since Jesus
342 |= {yer/@ud mot/@ud day/@ud}
344 => .(mot (dec mot), day (dec day))
348 =+ cah=?:((yelp yer) moy:yo moh:yo)
352 $(mot (dec mot), cah (slag 1 cah), day (add day (snag 0 cah)))
357 $(yer ney, day (add day ?:((yelp ney) 366 365)))
358 ?. =(0 (mod yer 100))
360 $(yer nef, day (add day ?:((yelp nef) 1.461 1.460)))
361 ?. =(0 (mod yer 400))
363 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
364 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
382Accept a parsed date of form `[[a=? y=@ud] m=@ud t=tarp]` and produce
383its `@d`representation.
398 ++ year :: date to @d
403 (add 292.277.024.400 y.det)
404 (sub 292.277.024.400 (dec y.det))
405 =+ day=(yawn yer m.det d.t.det)
406 (yule day h.t.det m.t.det s.t.det f.t.det)
412 > (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]])
413 0x8000000d227df4e9d940000000000000
420Produce a parsed daily time format from an atomic date.
427 ++ yell :: tarp from @d
432 =+ [muc=4 raw=(end 6 1 now)]
434 ?: |(=(0 raw) =(0 muc))
437 [(cut 4 [muc 1] raw) $(raw (end 4 muc raw))]
438 =+ day=(div sec day:yo)
439 => .(sec (mod sec day:yo))
440 =+ hor=(div sec hor:yo)
441 => .(sec (mod sec hor:yo))
442 =+ mit=(div sec mit:yo)
443 => .(sec (mod sec mit:yo))
444 [day hor mit sec fan]
451 > (yell ~2014.3.20..05.42.53..7456)
452 [d=106.751.991.820.094 h=5 m=42 s=53 f=~[0x7456]]
453 > (yell ~2014.6.9..19.09.40..8b66)
454 [d=106.751.991.820.175 h=19 m=9 s=40 f=~[0x8b66]]
456 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
464Determines whether a year contains an ISO 8601 leap week. Produces a
470`yer` is an unsigned decimal, `@ud`.
482 &(=(0 (mod yer 4)) |(!=(0 (mod yer 100)) =(0 (mod yer 400))))
501Produces a `++date` from a `@d`
516 ++ yore :: @d to date
521 :- ?: (gth y.ger 292.277.024.400)
522 [a=& y=(sub y.ger 292.277.024.400)]
523 [a=| y=+((sub 292.277.024.400 y.ger))]
524 [m.ger d.ger h.rip m.rip s.rip f.rip]
531 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=17 s=1 f=~[0x700d]]]
533 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=28 s=53 f=~[0x7b82]]]
540Daily time to time atom
542Accept a `++tarp`, a parsed daily time, and produces a time atom,
572 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
573 (con (lsh 6 1 sec) fac)
579 > =murica (yell ~1776.7.4)
581 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
583 0x8000000b62aaf5800000000000000000
586 > `@da`(yule (yell ~2014.3.20..05.42.53..7456))
587 ~2014.3.20..05.42.53..7456
588 > `tarp`[31 12 30 0 ~]
589 [d=31 h=12 m=30 s=0 f=~]
590 > `@dr`(yule `tarp`[31 12 30 0 ~])
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list