CURRENTDATETIME
The CURRENTDATETIME returns the current system date and time.
You can use this function when you need to map the current system date and time to an item that includes both a date and time portion.
.
- Syntax:
- CURRENTDATETIME ( [ single-text-expression ] )
- Meaning:
- CURRENTDATETIME ( [ date_time_format_string ] )
- Returns:
- A single date-time
CURRENTDATETIME has no arguments but it does require parentheses.
The CURRENTDATETIME function returns the system date and time in the format specified by date_time_format_string or with a CCYYMMDDHHMMSS presentation if no date_time_format_string is provided.
The date_time_format_string must conform to the date/time format strings as described in "Format strings".
{CCYY-MM-DD}T{HH24:MM:SS.3-3+/-ZZ:ZZ}
To specify a different output
format, use Xerces XML instead.Examples
- StartDateTime = CURRENTDATETIME ( )
In this example, StartDateTime is assigned the value of the current date and time. Because CURRENTDATETIME is assigned to an output, it is automatically converted to the presentation of StartDateTime.
If CURRENTDATETIME evaluates to 3:04pm on 6/24/1999 and StartDateTime has a YYMMDDHH12MM presentation, the result is 9906240304.
- CURRENTDATETIME ( "{MM.DD.CCYY HH24:MM}"
)
In this example, the current date is returned in MM.DD.CCYY HH24:MM format. If it is currently 4:12 pm on January 5, 1999, the date returned would be 01.05.1999 16:12.
Related Functions
- CURRENTDATE
- CURRENTTIME
- FROMDATETIME
- DATETOTEXT