4 ms·
With the TXR language: @(collect) @year-@month-@{day}T@hh:@mm:@ss-@tzh:@tzm @(end) @(output) @ (repeat) @hh:@mm on @month-@day @ (end) @(end)
by kazinator 12y ago
With the TXR language:
@(collect)
@year-@month-@{day}T@hh:@mm:@ss-@tzh:@tzm
@(end)
@(output)
@ (repeat)
@hh:@mm on @month-@day
@ (end)
@(end)
Or:
@(repeat)
@year-@month-@{day}T@hh:@mm:@ss-@tzh:@tzm
@(do
(put-line `@hh:@mm on @month-@day`))
@(end)
On the command line:
$ txr -c '@(repeat)
blah
...
@(end)' - # dash for stdin or file name
From a file:
$ txr script.txr file
I see we have a mistake in the handling of time zones; the minus sign is part of the time zone offset. Perhaps a small dash of regex, maybe:
@year-@month-@{day}T@hh:@mm:@ss@{tzh /[+-]\d\d/}:@tzm