create W3CDTF from date (a) for Target Timezone (b)

This function creates a W3CDTF-formatted text that represents the date or time stamp a using the time zone b. The time zone can be given in abbreviated form (e.g. GMT or CET) or in the form of GMT+1 or in full form. If the value SYSTEM is used, the local system's time zone will be used.

Older shortened TZ names, as for example CET, are still valid but no longer recommended.

Parameters


Parameter

Description

a

Date or Timestamp (with data type Date or Timestamp).

b

(optional) Time zone. Default: Local time zone.

Important note : The abbreviated forms should be avoided because some of them have been used for different time zones, making it impossible to ensure the usage of the correct one. Java only supports these forms for backwards compatibility reasons. After an update of the Java Virtual Machine or the operating system, it is possible that a profile returns a different result. Allowed abbreviations: GMT, UTC, SYSTEM (local time zone of server).

Examples:

America/New_York

Europe/Berlin

Examples


Running on a system with local time zone "Europe/Berlin". Parameter a is a timestamp in this time zone.


Parameter a

Parameter b

Result

Note

2011-08-15 12:34:56


2001-08-15T12:34:56+02:00

Date is in daylight saving time. The target time zone is the local time zone (Europe/Berlin).

2011-08-15 12:34:56

SYSTEM

2001-08-15T12:34:56+02:00

Date is in daylight saving time. The target time zone is SYSTEM (Europe/Berlin).

2011-08-15 12:34:56

UTC

2001-08-15T10:34:56Z

Date is in daylight saving time. The target time zone is UTC.

2011-08-15 12:34:56

America/New_York

2011-08-15T06:34:56-04:00

Date is in daylight saving time. The target time zone is New York.

2012-01-30 12:34:56


2012-01-30T12:34:56+01:00

The date is in the wintertime of the local time zone.

Important note


The result of this function is a text with type "String". If you import the structure from XSD, then please check the data type of W3CDTF fields and adjust it if needed.

Example profile


Package-TEST_W3CDTF_EN.pak