CURRENTDATETIMEZONE

The CURRENTDATETIMEZONE returns the current time in the specified time zone; if a format string is provided, the resulting time is formatted as specified.

You can use CURRENTTIME when you need the system time as a transaction processing time, an order-received time, or a time that reflects when the data was mapped.

Syntax:
CurrentDateTimeZone (single-text-expression [,single-text-expression])
Meaning:
CurrentDateTimeZone (Target time zone [, date_time_format_string])
Returns:
A single date-time

The CURRENTDATETIMEZONE function returns the system date and time, adjusted to the specified time zone, in the format specified by date_time_format_string, or with a CCYYMMHHMMSS 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".

Note: The output format for the native schema XML date/time field is always:{CCYY-MM-DD}T{HH24:MM:SS.3-3+/-ZZ:ZZ}To specify a different output format use Xerces XML.

Examples

  • StartDateTime = CURRENTDATETIMEZONE ("America/New_York" )

    In this example, StartDateTime is assigned the value of the current date and time, adjusted to the U.S Eastern time zone. Because CURRENTDATETIMEZONE is assigned to an output, it is automatically converted to the presentation of StartDateTime. If CURRENTDATETIMEZONE evaluates to 3:04pm on 10/13/2020 and StartDateTime has a YYMMDDHH12MM presentation, the result is 2010130304.

  • CURRENTDATETIMEZONE (“+0100�?, "{MM.DD.CCYY HH24:MM}" )

    In this example, the current date and time in Paris is returned in MM.DD.CCYY HH24:MM format. If it is currently 4:12 pm in Paris on October 13, 2020, the date returned would be 10.13.2020 16:12 .