beautypg.com

Date, Datetime, Default – Xylem System 5000 BASIC Manual User Manual

Page 21

background image

19

Basic Commands and Functions

A parameter to the DATETIME function returning the current day as a number, formatted as DD.

var = DATETIME(DAY)

REM stores 16, inferring the 16th day

DAY

A parameter to the DATETIME function returning a string representation of the current date,

formatted according to the System 5000 Settings (default is “MM/DD/YYYY”).

var$ = DATETIME(DATE$) REM stores “12/31/2009”, inferring Dec 31, 2009

DATE$

Used to retrieve the current date, time, subset thereof, or alarm time. Available parameters are
DATE, DATE$, DAY, JDAY, MONTH, YEAR, TIME, TIME$, SECONDS, MINUTES,
HOURS, EPOCH, EPOCHDAY, and ALARM$. DATE and TIME return integer values of the
current date and time formatted as YYMMDD and HHMMSS respectively. The DATE$ and
TIME$ parameters return a similar format as string values, specifically “MM/DD/YYYY”
according to the System 5000™ Date Format setting and “HH:MM:SS” respectively. The
ALARM$ parameter returns the most recent triggered alarm time, returned as a string formatted
as “HH:MM:SS”.

SECONDS, MINUTES, HOURS, DAY, MONTH, and YEAR each return a two-digit integer
value of the specified current date or time subsection. JDAY returns a three-digit integer value
of the Julian Day. EPOCH returns an integer value of the number of seconds since 00:00:00 Jan
1, 1970 while EPOCHDAY returns the number of seconds from 00:00:00 Jan 1, 1970 until the
start of today’s date at 00:00:00.

var = DATETIME(DATE)

REM stores 91231, inferring Dec 31, 2009

var$ = DATETIME(TIME$) REM stores the current time, e.g. “12:00:20”

DATETIME

Used within a SWITCH-CASE statement to mark the default route if no other CASE statements are matched.

var = MINUTES

SWITCH var

CASE 0: PRINT “Top of the hour” : BREAK

CASE 15: PRINT “15 Minutes Past” : BREAK

CASE 30: PRINT “Half Past” : BREAK

CASE 45: PRINT “45 Minutes Past” : BREAK

DEFAULT: PRINT “Not a 15-minute interval” : BREAK

END SWITCH

DEFAULT