149
CLEM Language Reference
Function Result Description
datetime_time(ITEM) Time Returnsthe tim e value of the given ITEM.
datetime_timestamp(YEAR,
MONTH,D AY,HOUR, MINUTE,
SECOND)
Timestamp
Returns the timestamp value for the given YEAR,
MONTH,DAY,HOUR,MINUTE,and SECON D.
datetime_timestamp(DATE,
TIME) Timestamp Returnsthe timestamp value for the g iven DATEand
TIME.
datetime_timestamp(NUMBE R) Timestamp Returnsthe timestamp value of the given number of
seconds.
datetime_weekday(DATE) Integer Returnsthe day of the week from the given DATEor
timestamp.
datetime_year(DATE) Integer Returns the year from a DATE or timestamp. The
result is an integer such as 2002.
date_weeks_difference (DATE1,
DATE2) Real
Returnsth e time in weeks from the date or timestamp
represented by DATE1to that repre sented by DATE2,
asa real n umber. This is based on a week of 7.0 days.
If DATE2is b efore DATE1, this function returns a
negative number.
date_years_difference (DATE1,
DATE2) Real
Returns the time in years from the date or timestamp
represented by DATE1to that repre sented by DATE2,
asa real n umber. This is an approximate gure based
ona year o f 365.25 days. If DATE2 is before DATE1,
this function returns a negative number.
time_before(TIME1, TIME2) Boolean
Returns a value of true if TIME1 represents a time
or timestamp before that represented by TIME2.
Otherwise, this function returns a value of 0.
time_hours_difference (TIME1,
TIME2) Real
Returnsthe time di fferencein hours betwe enthe tim es
or timestamps represented by TIME1 and TIME2, as
a real number. If you select Rollover days/mins in the
streampr operties dialog box, a higher value of TIME1
is taken to refer to the previous day. If you do not
select the rollover option, a higher value of TIME1
causes the returned value to be negative.
time_in_hours(TIME) Real
Returns the time in hours represented by TIME, as a
real number. For example, under time format HHMM,
theex pression time_in_hours('0130') evaluates to 1.5.
TIME can represent a time or a timestamp.
time_in_mins(TIME) Real
Returns the time in minutes represented by TIME,
as a real number. TIME can represent a time or a
timestamp.
time_in_secs(TIME) Integer Returns the time in seconds represented by TIME, as
aninteg er. TIME can represent a time or a timestamp.