
PI1X Basic Programming Manual Ver. 1.10
52/156
3.9
Calendar and timer commands
Purpose
:
To set or to get the current date.
Syntax
:
DATE$ = X$
Y$ = DATE$
Example
:
PRINT “NOW:”+DATE$
DATE$=”20090115”
PRINT “SET:”+DATE$
Description
:
X$
is a string variable in the form of “yyyymmdd”.
DATE$ = X$, to set the current date.
Y$
is a string variable to be assigned to the result.
Y$ = DATE$,to get the current date, in the form “yyyymmdd”
Purpose
:
To get the day of the week.
Syntax
:
A% = DAY_OF_WEEK
Example
:
PRINT DAY_OF_WEEK
Description
:
A%
is an integer variable to be assigned to the result. A value of
1 to 7 represents Monday to Sunday respectively.
Purpose
:
To set or to get the current time.
Syntax
:
TIME$ = X$
Y$ = TIME$
Example
:
PRINT TIME$
TIME $="180831"
PRINT TIME$
Description
:
X$
is a string variable in the form of “hhmmss”.
TIME$ = X$, to set the current time.
Y$
is a string variable to be assigned to the result.
Y$ = TIME$, to get the current time, in the form of “hhmmss”.
Purpose
:
To return the number of seconds elapsed since the terminal is
powered on.
Syntax
:
A% = TIMER
Example
:
PRINT TIMER
Description
:
A%
is an integer variable to be assigned to the result.