User's Manual
149
CLEM Language Reference
Function
Result
Description
datetime_time(ITEM)
Time
Returns the time value of the given ITEM.
datetime_timestamp(YEAR,
MONTH, DAY, HOUR, MINUTE,
SECOND)
Timestamp
Returns the timestamp valu e for the given YEAR,
MONTH, DAY, HOUR, MINUTE, and SECOND.
datetime_timestamp(DATE,
TIME)
Timestamp
Returns the timestamp value for the given DATE and
TIME.
datetime_timestamp (NUMBER)
Timestamp
Returns the timestamp value of the given number of
seconds.
datetime_weekday(DATE)
Integer
Returns the day of the week from the given DATE or
timestamp.
datetime_year(DATE)
Integer
Returns the year from a DATE or timestamp. The
result is an inte ger such as 2002.
date_weeks_difference (DATE1,
DATE2)
Real
Returns the time in weeks from the date or timestamp
represented by DATE1 to that represented by DATE2,
as a real number. This is based on a week of 7.0 days.
If DATE2 is before 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 DATE1 to that represented by DATE2,
as a real number. This is an approximate figure based
on a year o f 365.25 d ays. 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 timesta
mp before that represented by TIME2.
Otherwise, this fu nction returns a value of 0.
time_hours_difference (TIME1,
TIME2)
Real
Returns the time difference in hours between the times
or timestamps represented by TIME1 and TIME2, as
a real number. I f you select Rollover days/mins in the
stream properties dialog box, a hig her value of TIME1
is taken to refer t o the previous day. If you do not
select the rollover op t i on, 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. Fo r example, under time format HHMM,
the expression time_in_hours('0130') evaluates to 1.5.
TIME can represent a time o r a timestamp.
time_in_mins(TIME)
Real
Returns the time in minut es 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
an integer. TIME can represent a time or a timestamp.