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