Altova MapForce 2024 Enterprise Edition

Adjusts an xs:date value to a specific time zone, or to no time zone at all. If the timezone argument is an empty sequence, the function returns an xs:date without a time zone. Otherwise, it returns an xs:date with a time zone.

mf-func-xpath2-adjust-date-to-timezone2

 

Languages

XQuery, XSLT 2.0, XSLT 3.0.

 

Parameters

Name

Type

Description

date

xs:date

The input value of type xs:date.

timezone

xs:dayTimeDuration

The time zone expressed as an xs:dayTimeDuration value. The value can be negative. For example, a time zone value of -5 hours can be expressed as -PT5H.

 

Example

The following mapping constructs both parameters to the adjust-date-to-timezone function from strings, using the corresponding XPath 2 constructor functions. The goal of the mapping is to adjust the time zone to -5 hours. This time zone can be expressed as -PT5H.

mf-func-xpath2-adjust-date-to-timezone-example2

XSLT 2.0 mapping

The function adjusts the date value to the time zone supplied as argument. Consequently, the mapping output is 2020-04-30-05:00.

© 2017-2023 Altova GmbH