The date-and-time system variables let you retrieve the system date and time in a variety of formats, as shown in the next table.
System variable | Description |
---|---|
result = currentDate () | Contains the current system date in eight-digit Gregorian format (yyyyMMdd); you can assign this system variable to a variable of type DATE. |
result = currentTime () | Contains the current system time in six-digit format (HHmmss); you can assign this system variable to a variable to type TIME. |
result = currentTimeStamp () | Contains the current system time and date as a timestamp in twenty-digit Julian format (yyyyMMddHHmmssffffff); you can assign this system variable to a variable of type TIMESTAMP. |
result = dateOf (aTimeStamp) | Returns a date derived from a variable of type TIMESTAMP. |
result = dateValue (dateAsString) | Returns a DATE value that corresponds to an input string. |
result = dateValueFromGregorian (gregorianIntegerDate) | Returns a DATE value that corresponds to an integer representation of a Gregorian date. |
result = dateValueFromJulian (julianIntegerDate) | Returns a DATE value that corresponds to an integer representation of a Julian date. |
result = dayOf (aTimeStamp) | Returns a positive integer that represents a day of the month, as derived from a variable of type TIMESTAMP. |
result = extend (extensionField [, mask]) | Converts a timestamp, time, or date into a longer or shorter timestamp value. |
result = intervalValue (intervalAsString) | Returns an INTERVAL value that reflects a string constant or literal. |
result = intervalValueWithPattern (intervalAsString[, intervalMask)] | Returns an INTERVAL value that reflects a string constant or literal and is built based on an interval mask that you specify. |
result = mdy (month, day, year) | Returns a DATE value derived from three integers that represent the month, day of the month, and year of a calendar date. |
result = monthOf (aTimeStamp) | Returns a positive integer that represents a month, as derived from a variable of type TIMESTAMP. |
result = timeOf ([aTimeStamp]) | Returns a string that represents the time of day derived from either a TIMESTAMP variable or the system clock. |
result = timestampFrom (tsDate tsTime) | Contains the current system time and date as a timestamp in twenty-digit Julian format (yyyyMMddHHmmssffffff); you can assign this system variable to a variable of type TIMESTAMP. |
result = timestampValue (timestampAsString) | Returns a TIMESTAMP value that reflects a string constant or literal. |
result = timestampValueWithPattern (timestampAsString[, timestampMask]) | Returns a TIMESTAMP value that reflects a string and is built based on a timestamp mask that you specify. |
result = timeValue (timeAsString) | Returns a TIME value that reflects a string constant or literal. |
result = weekdayOf (aTimeStamp) | Returns a positive integer (0-6) that represents a day of the week, as derived from a variable of type TIMESTAMP. |
result = yearOf (aTimeStamp) | Returns an integer that represents a year, as derived from a variable of type TIMESTAMP. |
To set a date, time, or timestamp variable, you can assign VGVar.currentGregorianDate, DateTimeLib.currentTime, and DateTimeLib.currentTimeStamp, respectively. The functions that return formatted character text cannot be used for this purpose.
Related reference
EGL statements