Retro Rocket OS
BASIC-Powered Operating System
Loading...
Searching...
No Matches
DAY Function
DAY(boolean-expression)

Returns the current day of the month (1–31).

  • Pass TRUE → local time (system time zone, if configured).
  • Pass FALSE → UTC (Coordinated Universal Time).

Examples

REM Print both local and UTC day
PRINT "Local day: "; DAY(TRUE)
PRINT "UTC day: "; DAY(FALSE)
REM Simple log timestamp
PRINT "Today is "; DAY(TRUE); "/"; MONTH(TRUE); "/"; YEAR(TRUE)
REM Check for month end
IF DAY(FALSE) = 31 THEN
PRINT "Last day of a long month (UTC)"
ENDIF

Notes

  • Returns values in the range 1–31, depending on the current month.
  • Local time behaviour depends on the OS time zone configuration. If no zone is configured, local and UTC values will be identical.
  • Works in tandem with MONTH and YEAR for complete date values.
  • Unlike some BASIC dialects, DAY does not return day-of-week; use WEEKDAY instead.

See also: MONTH · YEAR · WEEKDAY