Converting date/time types to text
EGL uses a different process to convert each date/time type to
text:
- TIMESTAMP
- EGL uses strLib.defaultTimestampFormat if
the variable has a valid value. If that format is not valid, EGL
throws a RuntimeException. If the format is an empty string, EGL
uses a portion of the following default format, which is based on
the mask that you used to define the TIMESTAMP variable: "yyyy-MM-dd
HH:mm:ss.SSSSSS". Consider the following example:
strLib.defaultTimestampFormat = ""; myTimestamp TIMESTAMP("HHmmss")? = "123102"; writeStdOut(myTimestamp); - TIME
- EGL uses strLib.defaultTimeFormat if the variable has a valid value. If that format is not valid, EGL throws a RuntimeException. If the format is an empty string, the result is an empty string.
- DATE
- EGL uses strLib.defaultDateFormat if the variable has a valid value. If that format is not valid, EGL throws a RuntimeException. If the format is an empty string, the result is an empty string.
- INTERVAL (months)
- EGL uses the mask that you used to define the variable to determine
the number of digits for each portion of the interval. The formatted
string can include the following characters, in the specified order:
- A sign (one character), if the value is negative
- The number of years (using the number of places specified in the mask)
- A hyphen (one character)
- The number of months (using the number of places specified in the mask)
- INTERVAL (seconds)
- EGL uses the mask that you used to define the variable to determine
the number of digits for each portion of the interval. The formatted
string can include the following characters, in the specified order:
- A minus sign (one character), if the value is negative
- The number of days (using the number of places specified in the mask)
- A space (one character)
- The number of hours (as specified in the mask)
- A colon (one character)
- The number of minutes (as specified in the mask)
- A colon (one character)
- The number of seconds (as specified in the mask)
- A decimal point (one character)
- The number of fractions of seconds (as specified in the mask)