IBM 15 Switch User Manual


 
147
CLEM Language Reference
Note: Date and time functions cannot be called from scripts.
Function
Result
Description
@TODAY
String
If you select Rollover days/mins in the stream properties
dialog box, this function returns the current date as a
string in the current date format. If you use a two-digit
date format and do not select Rollover days/mins, this
function returns $null$ on the current server. Note that
this function cannot be called from a script.
to_time(ITEM)
Time
Converts the storage of the specied eld to a time.
to_date(ITEM)
Date
Converts the storage of the specied eld to a date.
to_timestamp(ITEM)
Timestamp
Converts the storage of the specied eld to a
timestamp.
to_datetime(ITEM)
Datetime
Converts the storage of the specied eld to a date,
time, or timestamp value.
datetime_date(ITEM)
Date
Returns the
date value for a number, string, or
timestamp. Note this is the only funct i on that allows
you to convert a number (in seconds) back to a date.
If ITEM is a
string, creates a date by parsi ng a string
in the current date format. The dat e format specied
in the stream properties dialog box must be correct for
this funct
ion to be successful. If ITEM is a number, it
is interpreted as a number of seconds since the base
date (or epoch). Fractions of a day are truncat ed. If
ITEM is ti
mestamp, the date part of the t i mestamp is
returned. If ITEM is a date, it is returned unchanged.
date_before(DATE1, DATE2)
Boolean
Returns a value of true if DATE1 represents a date
or timestamp before that represented by DATE2.
Otherwise, this function returns a value of 0.
date_days_difference(DATE1,
DATE2)
Integer
Returns the time in days from the d ate or timestamp
represented by DATE1 to that represented by DATE2,
as an integer. If DATE2 is before DATE1, this function
returns a negative number.
date_in_days(DATE)
Integer
Returns the time in days from the baseline date to the
date or timestamp represented by DATE, as an integer.
If DATE is before the baseline date, this function
returns a negative number. You must include a valid
date for the ca l culation to work appropriately. For
example, you should not specify 29 February 2001 as
the date. Because 2001 is a not a leap year, this date
does not exist.
date_in_months(DATE)
Real
Returns the time in months from the baseline dat e t o
the date or timestamp represented by DATE, as a real
number. This is an approximate gure based on a
month of 30.4375 days. If DATE is before the baseline
date, this function returns a negative number. You
must include a valid date f or the calculation to work
appropriately. For example, you should not specify 29
February 2001 as the date. Because 2001 is a not a
leap year, this date does not exist.