This sample demonstrates how to obtain the current system date and time via the intrinsic function CURRENT-DATE.
The program uses FUNCTION CURRENT-DATE to get the current date and time values, and formats the date and time information in various ways.
Compared with the older method of using the ACCEPT statement to obtain system date and time values, the CURRENT-DATE function offers the advantage that it provides timezone offset information. However, it provides the time value only down to a precision of whole seconds. For a comparison with the ACCEPT method, please see the DATE2 sample program.
The format looks like this:
[19/Jan/2021:05:51:04 -0800]
The format looks like this:
January 19th, 2021
The format looks like this (representing January 19, 2021):
01/19/21
The format looks like this (representing January 19, 2021):
19.01.21