


Types 
time 
 Describes times and dates.  
time
const type: time 
Describes times and dates.
For dates the proleptic Gregorian calendar is used (which assumes
that the Gregorian calendar was even in effect at dates preceding
its official introduction). This convention is used according to
ISO 8601 which also defines that positive and negative years exist
and that the year preceding 1 is 0. Time is measured in hours,
minutes, seconds and micro seconds. Additionally information about
the difference to UTC and a flag indicating daylight saving time
is maintained also.
Operator Summary 
time 
(attr time) parse (in var string: stri) 
 Convert a string in the ISO 8601 date format to a time.  
boolean 
(in time: aTime1) = (in time: aTime2) 
 Check if two time values are equal.  
boolean 
(in time: aTime1) <> (in time: aTime2) 
 Check if two time values are not equal.  
boolean 
(in time: aTime1) <= (in time: aTime2) 
 Check if aTime1 is less than or equal to aTime2.  
boolean 
(in time: aTime1) >= (in time: aTime2) 
 Check if aTime1 is greater than or equal to aTime2.  
boolean 
(in time: aTime1) < (in time: aTime2) 
 Check if aTime1 is less than aTime2.  
boolean 
(in time: aTime1) > (in time: aTime2) 
 Check if aTime1 is greater than aTime2.  
Function Summary 
boolean 
isLeapYear (in integer: year) 
 Determine if a year is a leap year in the Gregorian calendar.  
integer 
daysInYear (in integer: year) 
 Determine the number of days in a 'year'.  
integer 
daysInMonth (in integer: year, in integer: month) 
 Determine the number of days in the 'month' of the given 'year'.  
integer 
daysInMonth (in time: date) 
 Determine the number of days in the month of a given date.  
string 
strDate (in time: aTime) 
 Convert a time to a string with ISO 8601 YYYYMMDD date format.  
string 
strTime (in time: aTime) 
 Convert a time to a string with ISO 8601 hh:mm:ss time format.  
string 
strDateTime (in time: aTime) 
 Convert a time to a string with ISO 8601 date and time format.  
string 
str (in time: aTime) 
 Convert a time to a string with ISO 8601 date and time format.  
integer 
compare (in time: aTime1, in time: aTime2) 
 Compares two times.  
integer 
hashCode (in time: aTime) 
 Compute the hash value of a time.  
time 
truncToSecond (in time: aTime) 
 Truncate 'aTime' to the beginning of a second.  
time 
truncToMinute (in time: aTime) 
 Truncate 'aTime' to the beginning of a minute.  
time 
truncToHour (in time: aTime) 
 Truncate 'aTime' to the beginning of a hour.  
time 
truncToDay (in time: aTime) 
 Truncate 'aTime' to the beginning of a day.  
time 
truncToMonth (in time: aTime) 
 Truncate 'aTime' to the beginning of the first day in the month.  
time 
truncToYear (in time: aTime) 
 Truncate 'aTime' to the beginning of the first day in the year.  
integer 
dayOfWeek (in time: aDate) 
 Return the weekday number of 'aDate'.  
integer 
dayOfYear (in time: aDate) 
 Return the day number in the year of 'aDate'.  
integer 
weekOfYear (in var integer: year, in integer: dayOfYear) 
 Return the week number of the 'year' for the 'dayOfYear'.  
integer 
weekOfYear (in time: aDate) 
 Return the week number of the year for 'aDate'.  
integer 
weekDateYear (in time: aDate) 
 Return the year of the ISO 8601 week date for 'aDate'.  
integer 
weekDateWeek (in time: aDate) 
 Return the week number of the ISO 8601 week date for 'aDate'.  
time 
toUTC (in time: aTime) 
 Convert a time to Coordinated Universal Time (UTC).  
time 
setLocalTZ (in time: aTime) 
 Sets timeZone and daylightSavingTime for a given time.  
integer 

time 

integer 
timestamp1970 (in time: aTime) 
 Return a time expressed in seconds since the Unix Epoch.  
time 
timestamp1970ToTime (in integer: timestamp) 
 Convert a timestamp into a time from the local time zone.  
time 
time (NOW) 
 Determine the current local time.  
time 
time (in integer: year, in integer: month, in integer: day,
in integer: hour, in integer: minute, in integer: second) 
 Return the specified UTC time.  
time 
timeInTimeZone (in integer: year, in integer: month, in integer: day,
in integer: hour, in integer: minute, in integer: second, in integer: timeZone) 
 Return the specified time in the specified timeZone.  
time 
date (in integer: year, in integer: month, in integer: day) 
 Return the specified UTC date.  
void 
await (ref time: aTime) 
 Wait until 'aTime' is reached  
parse
const func time: (attr time) parse (in var string: stri) 
Convert a string in the ISO 8601 date format to a time.
The accepted ISO 8601 date formats are YYYYMM, YYYYMMDD,
YYYYMMDDTHH, YYYYMMDDTHH:MM, YYYYMMDDTHH:MM:SS
Additionally a space is also allowed to seperate the date and the
time representations: YYYYMMDD HH, YYYYMMDD HH:MM,
YYYYMMDD HH:MM:SS
 Returns:
 the time result of the conversion.
 Raises:
 RANGE_ERROR  When stri contains not a valid time value.
=
const func boolean: (in time: aTime1) = (in time: aTime2) 
Check if two time values are equal.
 Returns:
 TRUE if both times are equal, FALSE otherwise.
<>
const func boolean: (in time: aTime1) <> (in time: aTime2) 
Check if two time values are not equal.
 Returns:
 FALSE if both times are equal, TRUE otherwise.
<=
const func boolean: (in time: aTime1) <= (in time: aTime2) 
Check if aTime1 is less than or equal to aTime2.
 Returns:
 TRUE if aTime1 is less than or equal to aTime2, FALSE otherwise.
>=
const func boolean: (in time: aTime1) >= (in time: aTime2) 
Check if aTime1 is greater than or equal to aTime2.
 Returns:
 TRUE if aTime1 is greater than or equal to aTime2, FALSE otherwise.
<
const func boolean: (in time: aTime1) < (in time: aTime2) 
Check if aTime1 is less than aTime2.
 Returns:
 TRUE if aTime1 is less than aTime2, FALSE otherwise.
>
const func boolean: (in time: aTime1) > (in time: aTime2) 
Check if aTime1 is greater than aTime2.
 Returns:
 TRUE if aTime1 is greater than aTime2, FALSE otherwise.
isLeapYear
const func boolean: isLeapYear (in integer: year) 
Determine if a year is a leap year in the Gregorian calendar.
 Returns:
 TRUE if the year is a leap year, FALSE otherwise.
daysInYear
const func integer: daysInYear (in integer: year) 
Determine the number of days in a 'year'.
 Returns:
 the number of days in the year.
daysInMonth
const func integer: daysInMonth (in integer: year, in integer: month) 
Determine the number of days in the 'month' of the given 'year'.
 Returns:
 the number of days in the month.
daysInMonth
const func integer: daysInMonth (in time: date) 
Determine the number of days in the month of a given date.
 Returns:
 the number of days in the month.
strDate
const func string: strDate (in time: aTime) 
Convert a time to a string with ISO 8601 YYYYMMDD date format.
 Returns:
 the string result of the conversion.
strTime
const func string: strTime (in time: aTime) 
Convert a time to a string with ISO 8601 hh:mm:ss time format.
 Returns:
 the string result of the conversion.
strDateTime
const func string: strDateTime (in time: aTime) 
Convert a time to a string with ISO 8601 date and time format.
The time is converted to the YYYYMMDD hh:mm:ss format.
Microseconds, time zone and information about the daylight
saving time are omitted.
 Returns:
 the string result of the conversion.
str
const func string: str (in time: aTime) 
Convert a time to a string with ISO 8601 date and time format.
The string has the format YYYYMMDD hh:mm:ss.uuuuuu followed by a
time zone in the format UTC+n and (DST) when it is a daylight
saving time. The microseconds (uuuuuu) are omitted when they are
zero. A time zone of UTC+0 is also omitted.
 Returns:
 the string result of the conversion.
compare
const func integer: compare (in time: aTime1, in time: aTime2) 
Compares two times.
 Returns:
 1, 0 or 1 if the first argument is considered to be respectively less than, equal to, or greater than the second.
hashCode
const func integer: hashCode (in time: aTime) 
Compute the hash value of a time.
 Returns:
 the hash value.
truncToSecond
const func time: truncToSecond (in time: aTime) 
Truncate 'aTime' to the beginning of a second.
 Returns:
 the truncated time.
truncToMinute
const func time: truncToMinute (in time: aTime) 
Truncate 'aTime' to the beginning of a minute.
 Returns:
 the truncated time.
truncToHour
const func time: truncToHour (in time: aTime) 
Truncate 'aTime' to the beginning of a hour.
 Returns:
 the truncated time.
truncToDay
const func time: truncToDay (in time: aTime) 
Truncate 'aTime' to the beginning of a day.
 Returns:
 the truncated time.
truncToMonth
const func time: truncToMonth (in time: aTime) 
Truncate 'aTime' to the beginning of the first day in the month.
 Returns:
 the truncated time.
truncToYear
const func time: truncToYear (in time: aTime) 
Truncate 'aTime' to the beginning of the first day in the year.
 Returns:
 the truncated time.
dayOfWeek
const func integer: dayOfWeek (in time: aDate) 
Return the weekday number of 'aDate'.
 Returns:
 1 for monday, 2 for tuesday, and so on up to 7 for sunday.
dayOfYear
const func integer: dayOfYear (in time: aDate) 
Return the day number in the year of 'aDate'.
 Returns:
 1 for the 1. of january and successive values up to 366.
weekOfYear
const func integer: weekOfYear (in var integer: year, in integer: dayOfYear) 
Return the week number of the 'year' for the 'dayOfYear'.
According to ISO 8601: Week number 1 of every year contains the
4. of january. Since 1st to 3rd of january might be in the
previous week there can be also a week number 0.
 Returns:
 a week number from 0 to 53 for weeks belonging to the year of the given date.
weekOfYear
const func integer: weekOfYear (in time: aDate) 
Return the week number of the year for 'aDate'.
According to ISO 8601: Week number 1 of every year contains the
4. of january. Since 1st to 3rd of january might be in the
previous week there can be also a week number 0.
 Returns:
 a week number from 0 to 53 for weeks belonging to the year of the given date.
weekDateYear
const func integer: weekDateYear (in time: aDate) 
Return the year of the ISO 8601 week date for 'aDate'.
At the beginning and the end of an Gregorian calendar year there
might be days which belong to a week of the previous or next year.
For example 20050101 is 2004W536 and 20071231 is 2008W011.
 Returns:
 the year in the range 'pred(aDate.year)' to 'succ(aDate.year)'.
weekDateWeek
const func integer: weekDateWeek (in time: aDate) 
Return the week number of the ISO 8601 week date for 'aDate'.
At the beginning and the end of an Gregorian calendar year there
might be days which belong to a week of the previous or next year.
For example 20050101 is 2004W536 and 20071231 is 2008W011.
 Returns:
 the week number in the range 1 to 53.
toUTC
const func time: toUTC (in time: aTime) 
Convert a time to Coordinated Universal Time (UTC).
 Returns:
 the time in UTC.
setLocalTZ
const func time: setLocalTZ (in time: aTime) 
Sets timeZone and daylightSavingTime for a given time.
 Returns:
 the time in the local time zone.
julianDayNumber
const func integer: julianDayNumber (in time: aDate) 
Compute the julian day number of 'aDate'.
The julian day number is the number of days that have elapsed
since January 1, 4713 BC in the proleptic Julian calendar.
 Returns:
 the julian day number.
julianDayNumToTime
const func time: julianDayNumToTime (in integer: julianDayNumber) 
Return the time of a 'julianDayNumber'.
The julian day number is the number of days that have elapsed
since January 1, 4713 BC in the proleptic Julian calendar.
 Returns:
 the time 0:00:00 at the day with the 'julianDayNumber'.
timestamp1970
const func integer: timestamp1970 (in time: aTime) 
Return a time expressed in seconds since the Unix Epoch.
The Unix Epoch (19700101 00:00:00 UTC) corresponds to 0.
 Returns:
 the seconds since the Unix Epoch.
timestamp1970ToTime
const func time: timestamp1970ToTime (in integer: timestamp) 
Convert a timestamp into a time from the local time zone.
The timestamp is expressed in seconds since the Unix Epoch.
The Unix Epoch (19700101 00:00:00 UTC) corresponds to 0.
 Returns:
 the local time that corresponds to the timestamp.
time
const func time: time (NOW) 
Determine the current local time.
 Returns:
 the current local time.
time
const func time: time (in integer: year, in integer: month, in integer: day,
in integer: hour, in integer: minute, in integer: second) 
Return the specified UTC time.
timeInTimeZone
const func time: timeInTimeZone (in integer: year, in integer: month, in integer: day,
in integer: hour, in integer: minute, in integer: second, in integer: timeZone) 
Return the specified time in the specified timeZone.
date
const func time: date (in integer: year, in integer: month, in integer: day) 
Return the specified UTC date.
await
const proc: await (ref time: aTime) 
Wait until 'aTime' is reached


