currentTimeStamp()
The dateTimeLib.currentTimeStamp() system function retrieves the current system time and date as a timestamp in twenty-digit format ("yyyyMMddHHmmssffffff").
The precision of the this function is limited to the precision
of the timer in the runtime environment. For example, Java™ environments return the current timestamp
to the nearest millisecond, so the most precise timestamp available
in a Java™ environment will have
17 significant digits and three trailing zeros, such as 20070101142020123000.
Syntax
dateTimeLib.currentTimeStamp( )
returns (result TIMESTAMP("yyyyMMddHHmmssffffff"))
- result
- A TIMESTAMP value that represents the current system time and date. You can assign this result to any variable that is assignment compatible with TIMESTAMP. See Assignment compatibility in EGL.
Example
In the following example, assume the following conditions:
- A strLib.defaultDateFormat of "M/d/yy"
- A strLib.defaultTimeFormat of "h:mm a"
- A null strLib.defaultTimestampFormat
- A date of December 8, 2006
- A time of 14:07:42
myTime1 DATE = currentTimestamp();
writeStdOut(myTime1);
myTime2 TIME = currentTimestamp();
writeStdOut(myTime2);
writeStdOut(currentTimestamp());
The console displays the following results:
12/8/06
2:07 PM
2006-12-08 14:07:42.950000