home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
APPS
/
lout2.lzh
/
LOUT2
/
DOC
/
TR.LOUT
/
ch3.16
< prev
next >
Wrap
Text File
|
1994-01-25
|
2KB
|
50 lines
@Section
@Title { "@Moment" }
@Tag { moment }
@Begin
@PP
The predefined symbol @@Moment
moment.sym @Index { @@Moment symbol }
has the following definition:
@ID @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 {
@JP @Code "@Second" |0.5i the current second, between 0 and 59
@JP @Code "@Minute" | the current minute, between 0 and 59
@JP @Code "@Hour" | the current hour, between 0 and 23
@JP @Code "@Day" | the current day of the month, between 1 and 31
@JP @Code "@Month" | the current month, between 1 (January) and 12 (December)
@JP @Code "@Year" | the current year of the century, between 00 and 99
@JP @Code "@Century" | the current century, e.g. 19 or 20
@JP @Code "@WeekDay" | the current day of the week, between 1 (Sunday) and 7 (Saturday)
@JP @Code "@YearDay" | the current day of the year, between 0 and 365
@JP @Code "@DaylightSaving" | an implementation-dependent number that
may encode the daylight saving currently in effect
}
date @Index { Date, printing of current }
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