9 ++ yo :: time constants core
11Useful constants for interacting with earth time.
15Days in a century. Derived by multiplying the number of days in a year
16(365) by the number of years in a century (100), then adding the number
17days from leap years in a century (24).
27 |% ++ cet 36.524 :: (add 24 (mul 100 365))
36 > (sub (add 24 (mul 100 365)) cet:yo)
39------------------------------------------------------------------------
43Number of seconds in a day.
53 ++ day 86.400 :: (mul 24 hor)
63------------------------------------------------------------------------
77 ++ era 146.097 :: (add 1 (mul 4 cet))
83------------------------------------------------------------------------
89The number of seconds in an hour. Derived by multiplying the number of
90seconds in a minute by the minutes in an hour.
100 ++ hor 3.600 :: (mul 60 mit)
110------------------------------------------------------------------------
124 ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
132------------------------------------------------------------------------
138The number of seconds in a minute.
156------------------------------------------------------------------------
162The days in each month of the Gregorian common year. A list of unsigned
163decimal atoms (Either 28, 30, or 31) denoting the number of days in the
164month at the year at that index.
174 ++ moh `(list @ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
180 ~[31 28 31 30 31 30 31 31 30 31 30 31]
184------------------------------------------------------------------------
190The days in each month of the Gregorian leap-year. A list of unsigned
191decimal atoms (Either 29,30, or 31) denoting the number of days in the
192month at the leap-year at that index.
202 ++ moy `(list @ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
208 ~[31 29 31 30 31 30 31 31 30 31 30 31]
212------------------------------------------------------------------------
218The number of seconds in four years. Derived by adding one second to the
219number of seconds in four years.
229 ++ qad 126.144.001 :: (add 1 (mul 4 yer))
237------------------------------------------------------------------------
243The number of seconds in a year. Derived by multiplying the number of
244seconds in a day by 365.
254 ++ yer 31.536.000 :: (mul 365 day)
267Time since beginning of time
269Produce the date tuple of `[y=@ud m=@ud d=@ud]` of the year, month, and
270day from a number of days from the beginning of time.
284 ++ yall :: day / to day of year
286 ^- {y/@ud m/@ud d/@ud}
287 =+ [era=0 cet=0 lep=*?]
288 => .(era (div day era:yo), day (mod day era:yo))
290 ?: (lth day +(cet:yo))
292 => .(lep |, cet 1, day (sub day +(cet:yo)))
293 .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
294 =+ yer=(add (mul 400 era) (mul 100 cet))
295 |- ^- {y/@ud m/@ud d/@ud}
296 =+ dis=?:(lep 366 365)
299 $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
300 |- ^- {y/@ud m/@ud d/@ud}
301 =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
302 |- ^- {y/@ud m/@ud d/@ud}
303 =+ zis=(snag mot cah)
306 $(mot +(mot), day (sub day zis))
324Days since beginning of time
326Inverse of `yall`, computes number of days A.D. from y/m/d date as the
327tuple `[yer=@ud mot=@ud day=@ud]`.
332`yer` is an unsigned decimal, `@ud`.
334`mon` is an unsigned decimal, `@ud`.
336`day` is an unsigned decimal, `@ud`.
346 ++ yawn :: days since Jesus
347 |= {yer/@ud mot/@ud day/@ud}
349 => .(mot (dec mot), day (dec day))
353 =+ cah=?:((yelp yer) moy:yo moh:yo)
357 $(mot (dec mot), cah (slag 1 cah), day (add day (snag 0 cah)))
362 $(yer ney, day (add day ?:((yelp ney) 366 365)))
363 ?. =(0 (mod yer 100))
365 $(yer nef, day (add day ?:((yelp nef) 1.461 1.460)))
366 ?. =(0 (mod yer 400))
368 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
369 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
387Accept a parsed date of form `[[a=? y=@ud] m=@ud t=tarp]` and produce
388its `@d`representation.
403 ++ year :: date to @d
408 (add 292.277.024.400 y.det)
409 (sub 292.277.024.400 (dec y.det))
410 =+ day=(yawn yer m.det d.t.det)
411 (yule day h.t.det m.t.det s.t.det f.t.det)
417 > (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]])
418 0x8000000d227df4e9d940000000000000
425Produce a parsed daily time format from an atomic date.
432 ++ yell :: tarp from @d
437 =+ [muc=4 raw=(end 6 1 now)]
439 ?: |(=(0 raw) =(0 muc))
442 [(cut 4 [muc 1] raw) $(raw (end 4 muc raw))]
443 =+ day=(div sec day:yo)
444 => .(sec (mod sec day:yo))
445 =+ hor=(div sec hor:yo)
446 => .(sec (mod sec hor:yo))
447 =+ mit=(div sec mit:yo)
448 => .(sec (mod sec mit:yo))
449 [day hor mit sec fan]
456 > (yell ~2014.3.20..05.42.53..7456)
457 [d=106.751.991.820.094 h=5 m=42 s=53 f=~[0x7456]]
458 > (yell ~2014.6.9..19.09.40..8b66)
459 [d=106.751.991.820.175 h=19 m=9 s=40 f=~[0x8b66]]
461 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
469Determines whether a year contains an ISO 8601 leap week. Produces a
475`yer` is an unsigned decimal, `@ud`.
487 &(=(0 (mod yer 4)) |(!=(0 (mod yer 100)) =(0 (mod yer 400))))
506Produces a `++date` from a `@d`
521 ++ yore :: @d to date
526 :- ?: (gth y.ger 292.277.024.400)
527 [a=& y=(sub y.ger 292.277.024.400)]
528 [a=| y=+((sub 292.277.024.400 y.ger))]
529 [m.ger d.ger h.rip m.rip s.rip f.rip]
536 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=17 s=1 f=~[0x700d]]]
538 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=28 s=53 f=~[0x7b82]]]
545Daily time to time atom
547Accept a `++tarp`, a parsed daily time, and produces a time atom,
577 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
578 (con (lsh 6 1 sec) fac)
584 > =murica (yell ~1776.7.4)
586 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
588 0x8000000b62aaf5800000000000000000
591 > `@da`(yule (yell ~2014.3.20..05.42.53..7456))
592 ~2014.3.20..05.42.53..7456
593 > `tarp`[31 12 30 0 ~]
594 [d=31 h=12 m=30 s=0 f=~]
595 > `@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