on 140ac0e help sign in
58 lines 1.2 kB history raw
1### `++stud`
3Parse UTC format
5Accepts a [`++tape`]() containing a date in UTC format and produces the
6[`++unit`]() of a [`++date`]().
8Accepts
9-------
11`cud` is a `++tape`.
13Produces
14--------
16The `++unit` of a `++date`.
18Source
19------
21 ++ stud :: parse UTC format
22 |= cud=tape
23 ^- (unit date)
24 =- ?~ tud ~
25 `[[%.y &3.u.tud] &2.u.tud &1.u.tud &4.u.tud &5.u.tud &6.u.tud ~]
26 ^= tud
27 %+ rust cud
28 ;~ plug
29 ;~(pfix (stun [5 5] next) dim:ag)
30 ::
31 %+ cook
32 |= a=tape
33 =+ b=0
34 |- ^- @
35 ?: =(a (snag b (turn mon:yu |=(a=tape (scag 3 a)))))
36 +(b)
37 $(b +(b))
38 (ifix [ace ace] (star alf))
39 ::
40 ;~(sfix dim:ag ace)
41 ;~(sfix dim:ag col)
42 ;~(sfix dim:ag col)
43 dim:ag
44 (cold ~ (star next))
45 ==
46 ::
48Examples
49--------
51 ~zod/try=> (stud "Tue, 21 Oct 2014 21:21:55 +0000")
52 [~ [[a=%.y y=2.014] m=10 t=[d=21 h=21 m=21 s=55 f=~]]]
53 ~zod/try=> (stud "Wed, 11 Oct 2002 12:20:55 +0000")
54 [~ [[a=%.y y=2.002] m=10 t=[d=11 h=12 m=20 s=55 f=~]]]
55 ~zod/try=> (stud "Wed, 11 Oct 2002")
56 ~