XML information pipe

Ihre Spezialisten für XML

Banner Werbung

XSLT 2.0 reference

XSLT  |  functions

abs | adjust-date-to-timezone | adjust-dateTime-to-timezone | adjust-time-to-timezone | attribute | avg | base-uri& | boolean | ceiling | codepoint-equal | codepoint-to-string | collection | comment | compare | concat | contains | count | current | current-date | current-dateTime | current-group | current-grouping-key | current-time | data | day-from-date | day-from-dateTime | days-from-duration | deep-equal | default-collation | distinct-values | doc | doc-available | document | document-node | document-uri | element | element-available | empty | empty-sequence | encode-for-uri | ends-with | error | escape-html-uri | exactly-one | exists | false | floor | format-date | format-dateTime | format-time | function-available | generate-id | hours-from-dateTime | hours-from-duration | hours-from-time | id | idref | implicit-timezone | in-scope-prefixes | index-of | insert-before | iri-to-uri | item | key | lang | last | local-name | local-name-from-QName | lower-case | matches | max | min | minutes-from-dateTime | minutes-from-duration | minutes-from-time | month-from-date | month-from-dateTime | months-from-duration | name | namespace-uri | namespace-uri-for-prefix | namespace-uri-from-QName | nilled | node | node-name | normalize-space | not | number | one-or-more | position | prefix-from-QName | processing-instruction | QName | regex-group | remove | replace | resolve-QName | reserve | round | round-half-to-even | schema-attribute | schema-element | seconds-from-dateTime | seconds-from-duration | seconds-from-time | starts-with | static-base-uri | string | string-join | string-length | string-to-codepoints | subsequence | substring | substring-after | substring-before | sum | system-property | text | timezone-from-date | timezone-from-dateTime | timezone-from-time | tokenize | trace | translate | true | type-available | unordered | unparsed-entity-public-id | unparsed-entity-uri | unparsed-text | unparsed-text-available | upper-case | year-from-date | year-from-dateTime | years-from-duration | zero-or-one |


adjust-date-to-timezone

adjust-date-to-timezone($timezone)
     $timezone: xs:date
     returns: xs:date


Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00.


Example 1:
Input: adjust-date-to-timezone(xs:date("2002-03-07"))
Output: 2002-03-07-05:00

Example 2:
Input: adjust-date-to-timezone(xs:date("2002-03-07-07:00"))
Output: 2002-03-07-05:00

Example 3:
Input: adjust-date-to-timezone(xs:date("2002-03-07"), $tz)
Output: 2002-03-07-10:00

Example 4:
Input: adjust-date-to-timezone(xs:date("2002-03-07-07:00"), $tz)
Output: 2002-03-06-10:00

Example 5:
Input: adjust-date-to-timezone(xs:date("2002-03-07"), ()) )
Output: 2002-03-07

Example 6:
Input: adjust-date-to-timezone(xs:date("2002-03-07-07:00"), ())
Output: 2002-03-07
Locate in the official documentation

XSLT 2.0 reference