BASIC DATE and TIME Functions - fvdhoef/aquarius-plus GitHub Wiki

DATE$

TYPE: plusBASIC System function

FORMAT: DATE$

Action: Returns a string containing the current date.

  • The returned string is in the format "YYYYMMDD" (four digit year, two digit month, and two digit day of month).
Examples
PRINT DATE$ `

Prints the current date.

PRINT RIGHT$(DATE$,6_ `
> Prints the current date in "YYMMDD" format.

TIME$

TYPE: plusBASIC System function

FORMAT: TIME$

Action: Returns a string containing the current time.

  • The returned string is in the format "HHmmss" (two digit hour in the range 0 - 23, two digit minute, and two digit second).
Examples
PRINT TIME$

Prints the current time.

PRINT LEFT$(DATE$,4)

Prints the current year and month in "YYMM" format.


DATETIME$

TYPE: plusBASIC System function

FORMAT: DATETIME$

Action: Returns a string containing the current date and time.

  • The returned string is in the format "YYYYMMDDHHmmss".
  • DATETIME$ is equivalent to DATE$+TIME$
Examples
PRINT DATETIME$

Prints the current date and time.


TIMER

TYPE: plusBASIC systen pseudovariable

FORMAT: TIMER = count

Action: Sets and starts the countdown timer.

  • count is a number in the range 0 through 16,777,215.
    • Setting the timer to non-zero number starts the countdown.
    • Setting the timer to zero stops the timer.
  • The timer counts down in jiffies, each jiffy being 1/60th second.
    • When the count reaches 0, it stops.
Advanced - The timer is interrupt driven. - While the timer is running, it is decremented each VBLANK interrupt. - Starting the timer enables interrupts. - When the timer stops and no other interrupt routines are active, interrupts are disabled. - If a process disables interrupts, the timer will be paused until interrupts are reenabled.
Examples ``` TIMER = 300 ``` > Starts the countdown timer at 5 seconds.
TIMER = 0

Stops the countdown timer.


FORMAT: TIMER

Action: Returns the current timer count.

Examples
PRINT TIMER

Displays the current timer count.

10 IF TIMER THEN GOTO 10

Loops until timer reaches 0.

⚠️ **GitHub.com Fallback** ⚠️