create timestamp from W3CDTF()

This function creates a date from a text a being in the form of a W3CDTF date. Milliseconds are ignored.

If a cannot be parsed and b is specified, the function will fail with error message b. Otherwise, a timestamp with the current date will be returned.

Parameters


Parameter

Description

a

Date in W3CDTF format (always with data type String). Important note: The parameter expects the specification of the time with time zone! However, a value without a time zone is also tolerated, since this frequently occurs in practical input data. In this case the local setting (system) is assumed, for example Central European Summer Time (CEST). Careful: Up to version 4.0, UTC (Zone Z) was used for this! If a strict W3CDTF format check is desired, the function "create date strict(adjustable template)" should be used instead.

b

Error message.

Examples


The examples are based on the local time zone for Germany, i.e. UTC + 1 hour (wintertime) and UTC + 2 hours (daylight saving time). Assume the current date and time 20.08.2011 15:33:23, the local system's timezone is Europe/Berlin.


Parameter a

Parameter b

Result

Note

1994-08-05T13:15:30+02:00

Error while reading

1994-08-05 13:15:30 (as timestamp with time zone Europe/Berlin)

Daylight saving time.

1994-11-05T13:15:30+01:00

Error while reading

1994-11-05 13:15:30 (as timestamp with time zone Europe/Berlin)

Wintertime.

1994-08-05T13:15:30Z

Error while reading

1994-08-05 15:15:30 (as timestamp with time zone Europe/Berlin)

Daylight saving time.

1994-11-05T13:15:30Z

Error while reading

1994-11-05 14:15:30 (as timestamp with time zone Europe/Berlin)

Wintertime.

1994-11-05T13:15:30.852Z

Error while reading

1994-11-05 14:15:30 (as timestamp with time zone Europe/Berlin)

Milliseconds ignored.

No date

Error while reading

Function fails with error message Error while reading.


No date


2011-08-20 15:33:23 (as timestamp with time zone Europe/Berlin)

Current time.


Important note


The W3CDTF format is used in XML or HTML documents. The XML Schema Definition (XSD) will probably define the data type as date. Hence, importing an XSD will result in a field of type Date or Timestamp. But W3CDTF is not compatible with those data types in Lobster Integration. Please change the type to "String".