diff options
author | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 19:21:41 +0000 |
---|---|---|
committer | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 19:21:41 +0000 |
commit | 71bdb35d52747e6d7d9f55df4524d57c2966be94 (patch) | |
tree | 480ee5eefccc40d5f3331cc52d66f722fd19bfb9 /doc/expert/pre_mome | |
parent | b41263ea7578fa9742486135c762803b52794105 (diff) | |
download | lout-71bdb35d52747e6d7d9f55df4524d57c2966be94.tar.gz |
Lout 3.17.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@2 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'doc/expert/pre_mome')
-rw-r--r-- | doc/expert/pre_mome | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/doc/expert/pre_mome b/doc/expert/pre_mome new file mode 100644 index 0000000..d4d377c --- /dev/null +++ b/doc/expert/pre_mome @@ -0,0 +1,72 @@ +@Section + @Title { "@Moment" } + @Tag { moment } +@Begin +@PP +The predefined symbol @@Moment +moment.sym @Index { @@Moment symbol } +has the following definition: +@ID @OneRow @Code { +"def @Moment" +" named @Tag {}" +" named @Second {}" +" named @Minute {}" +" named @Hour {}" +" named @Day {}" +" named @Month {}" +" named @Year {}" +" named @Century {}" +" named @WeekDay {}" +" named @YearDay {}" +" named @DaylightSaving {}" +"{}" +} +It may be used like any other symbol. Lout provides an invocation of +@@Moment with tag {@Code now}, whose other parameters are numbers +encoding the current date and time: +@ID @OneRow @Tab + @Fmta { @Col @Code A ! @Col B } +{ +@Rowa + A { "@Second" } + B { the current second, usually between 00 and 59 } +@Rowa + A { "@Minute" } + B { the current minute, between 00 and 59 } +@Rowa + A { "@Hour" } + B { the current hour, between 00 and 23 } +@Rowa + A { "@Day" } + B { the current day of the month, between 1 and 31 } +@Rowa + A { "@Month" } + B { the current month, between 1 (January) and 12 (December) } +@Rowa + A { "@Year" } + B { the current year of the century, between 00 and 99 } +@Rowa + A { "@Century" } + B { the current century, e.g. 19 or 20 } +@Rowa + A { "@WeekDay" } + B { the current day of the week, between 1 (Sunday) and 7 (Saturday) } +@Rowa + A { "@YearDay" } + B { the current day of the year, between 0 and 365 } +@Rowa + A { "@DaylightSaving" } + B { an implementation-dependent number that may encode the +daylight saving currently in effect } +} +date @Index { Date, printing of current } +Unix manual entries state that @Code "@Second" can be as high as 61, to +allow for leap seconds. Judicious use of databases can convert these +numbers into useful dates. For example, +@ID @Code { +"@Moment&&now @Open { @Day {@Months&&@Month}, @Century{@Year} }" +} +produces something like +@Moment&&now @Open { @Day {@Months&&@Month}, @Century{@Year} } +given a suitable database of months. +@End @Section |