on 6d45ede help sign in
42 lines 650 B history raw
1---
2navhome: /docs
3---
6### `++daws`
8Weekday of date
10Produces the day of the week of a given date `yed` as an atom. Weeks are
11zero-indexed beginning on Sunday.
13Accepts
14-------
16`yed` is a [`++date`]().
18Produces
19--------
21An atom.
23Source
24------
26 ++ daws :: weekday of date
27 |= yed=date
28 %- mod :_ 7
29 (add (dawn y.yed) (sub (yawn [y.yed m.yed d.t.yed]) (yawn y.yed 1 1)))
30 ::
32Examples
33--------
35 ~zod/try=> (daws [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]])
36 5
37 ~zod/try=> (daws (yore -<-))
38 2
40(second example always returns the current date).