Lexical - F$CVTIME
Most useful for adding and subtracting days,
hours, minutes and/or seconds to/from a date.
$ NEXT_WEEK = F$CVTIME(“+7-”, “ABSOLUTE”,)
$ MONTH_END = (F$CVTIME(“+1-”,, “DAY”) .EQ. 1)
$ YEAR_END = (MONTH_END .AND. -
(F$CVTIME(“+1-”,, “MONTH”) .EQ. 1))
$ NOW = F$CVTIME( ,, “TIME” )
$ LATER = F$CVTIME( ,, “TIME” )
F$CVTIME( “’’LATER’-’’NOW’,, “TIME” )
Notes:
The F$CVTIME() function returns multiple elements of a date/time expression. It also performs conversion from one format to another, and allows for the addition or subtraction of days, hours, minutes, seconds, etc. from a known date/time or the current date time.
The examples show how to:
1. get the date/time for a week from now.
2. see if tomorrow is the first of the month/year.
3. get an elapsed time based on a starting time and an ending time (may not cross midnight more than once!).