sourcelibs/Dates/demos/literals.xtl

1⍝!/usr/bin/env xetal 2⍝# Date literals: d_ate< turns each into its day number when the program 3⍝# is compiled, so the program holds plain numbers and nothing parses a 4⍝# date when it runs. Run with "just demo Dates literals". 5 6ᵈ⁼u̲se< "Dates" 7landing ← @ ᵈd̲ate< "1969-07-20"
ᵈd̲ate< expands to
(-165)
8landing 9ᵈw̲eekday landing ⍝ 7: a Sunday 10(@ ᵈd̲ate< "2026-12-25") − @ ᵈd̲ate< "2026-10-03" ⍝ days to go
ᵈd̲ate< expands to
(20812)
ᵈd̲ate< expands to
(20729)
11ᵈi̲so @ ᵈd̲ate< "2000-02-29" ⍝ a leap day
ᵈd̲ate< expands to
(11016)