...
Times are internally represented as unsigned 3-byte integers representing the number of 10ms (1/100 of a second) intervals since the start of the day. Routines exist to convert between this format and an ASCII string, again with various options. Further routines are provided to read or set the machine time and date. The available routines are as follows, their specifications can be found in "System Calls Reference":
...
Gdt
convert
...
an
...
ASCII
...
string
...
to
...
an
...
internal
...
dateGN_
...
Pdt
convert
...
an
...
internal
...
date
...
to
...
an
...
ASCII
...
stringGN_
...
Die
convert
...
from
...
internal
...
to
...
external
...
formatGN_
...
Dei
convert
...
from
...
external
...
to
...
internal
...
formatGN_
...
Gmd
fetch
...
current
...
machine
...
dateGN_
...
Pmd
set
...
current
...
machine
...
dateGN_
...
Gtm
convert
...
an
...
ASCII
...
string
...
to
...
an
...
internal
...
timeGN_
...
Ptm
convert
...
an
...
internal
...
time
...
to
...
an
...
ASCII
...
stringGN_
...
Gmt
fetch
...
current
...
machine
...
timeGN_
...
Pmt
set
...
current
...
machine
...
timeGN_
...
Msc
convert
...
real
...
time
...
to
...
elapsed
...
timeGN_
...
Sdo
output
...
date
...
and
...
time
...
to
...
standard
...
output
Code Block | ||||
---|---|---|---|---|
| ||||
include "time.def" ; time & date call definitions include "stdio.def" ; standard I/O call definitions ; simple example to display the current date ; assumes IY points to at least 30 bytes of available memory ; this memory should not lie in segment 2 push iy pop de ; buffer for date oz GN_Gmd ; get machine date ; DE = DE(in) + 3 push iy pop hl ; source date ld a, 240 ; century output, C = interfield delimiter ld b, 15 ; expanded day and month (no AD/BC) ld c, '.' ; interfield delimiter oz GN_Pdt ; put date in ASCII format xor a ld (de),a ; null-terminate ASCII string push iy pop hl inc hl inc hl ; adjust string buffer address inc hl ; of converted string oz GN_Sop ; write string to std. output oz GN_Nln ; new line ret |