|
|
fn:adjust-date-to-timezone(
|
|
$arg as xs:date?,
|
|
[$timezone as xs:dayTimeDuration?]
|
| ) as xs:date? |
|
 |
Summary:
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.
If $timezone is not specified, then $timezone is the value of the implicit
timezone in the dynamic context.
If $arg is the empty sequence, then the result is the empty sequence.
A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or
greater than PT14H or if does not contain an integral number of minutes.
If $arg does not have a timezone component and $timezone is the empty
sequence, then the result is $arg.
If $arg does not have a timezone component and $timezone is not the empty
sequence, then the result is $arg with $timezone as the timezone component.
If $arg has a timezone component and $timezone is the empty sequence, then
the result is the localized value of $arg without its timezone component.
If $arg has a timezone component and $timezone is not the empty sequence, then:
Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and
date and timezone components that are the same as the date and timezone
components of $arg.
Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt,
$timezone)
The result of this function will be a date value that has date and timezone
components that are the same as the date and timezone components of $r.
|
Parameters:
$arg
:
The date to adjust to the new timezone.
|
$timezone
(optional):
The new timezone for the date.
|
|
Example:
Assume the dynamic context provides an implicit timezone
of -05:00 (-PT5H0M).
let $tz := xs:dayTimeDuration("-PT10H")
fn:adjust-date-to-timezone(xs:date("2002-03-07"))
returns 2002-03-07-05:00.
fn:adjust-date-to-timezone(xs:date("2002-03-07-07:00"))
returns 2002-03-07-05:00. $arg is converted to the xs:dateTime
"2002-03-07T00:00:00-07:00". This is adjusted to the implicit
timezone, giving "2002-03-07T02:00:00-05:00".
fn:adjust-date-to-timezone(
xs:date("2002-03-07"), $tz)
returns 2002-03-07-10:00.
fn:adjust-date-to-timezone(
xs:date("2002-03-07-07:00"), $tz)
returns 2002-03-06-10:00. $arg is converted to the xs:dateTime
"2002-03-07T00:00:00-07:00". This is adjusted to the given
timezone, giving "2002-03-06T21:00:00-10:00".
fn:adjust-date-to-timezone(xs:date("2002-03-07"), ())
returns 2002-03-07.
fn:adjust-date-to-timezone(
xs:date("2002-03-07-07:00"), ())
returns 2002-03-07.
|
|
|
|
fn:adjust-dateTime-to-timezone(
|
|
$arg as xs:dateTime?,
|
|
[$timezone as xs:dayTimeDuration?]
|
| ) as xs:dateTime? |
|
 |
Summary:
Adjusts an xs:dateTime value to a specific timezone, or to no
timezone at all. If $timezone is the empty sequence, returns an xs:dateTime
without a timezone. Otherwise, returns an xs:dateTime with a timezone.
If $timezone is not specified, then $timezone is the value of the implicit
timezone in the dynamic context.
If $arg is the empty sequence, then the result is the empty sequence.
A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or
greater than PT14H or if does not contain an integral number of minutes.
If $arg does not have a timezone component and $timezone is the empty
sequence, then the result is $arg.
If $arg does not have a timezone component and $timezone is not the empty
sequence, then the result is $arg with $timezone as the timezone component.
If $arg has a timezone component and $timezone is the empty sequence, then
the result is the localized value of $arg without its timezone component.
If $arg has a timezone component and $timezone is not the empty sequence,
then the result is an xs:dateTime value with a timezone component of
$timezone that is equal to $arg.
|
Parameters:
$arg
:
The dateTime to adjust to the new timezone.
|
$timezone
(optional):
The new timezone for the dateTime.
|
|
Example:
Assume the dynamic context provides an implicit timezone
of -05:00 (-PT5H0M).
let $tz := xs:dayTimeDuration("-PT10H")
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T10:00:00"))
returns 2002-03-07T10:00:00-05:00
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T10:00:00-07:00"))
returns 2002-03-07T12:00:00-05:00
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T10:00:00"), $tz)
returns 2002-03-07T10:00:00-10:00
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T10:00:00-07:00"), $tz)
returns 2002-03-07T07:00:00-10:00
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T10:00:00-07:00"),
xs:dayTimeDuration("PT10H"))
returns 2002-03-08T03:00:00+10:00
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T00:00:00+01:00"),
xs:dayTimeDuration("-PT8H"))
returns 2002-03-06T15:00:00-08:00
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T10:00:00"), ())
returns 2002-03-07T10:00:00
fn:adjust-dateTime-to-timezone(
xs:dateTime("2002-03-07T10:00:00-07:00"), ())
returns 2002-03-07T10:00:00
|
|
|
|
fn:adjust-time-to-timezone(
|
|
$arg as xs:date?,
|
|
[$timezone as xs:dayTimeDuration?]
|
| ) as xs:integer? |
|
 |
Summary:
Adjusts an xs:time value to a specific timezone, or to no timezone at
all. If $timezone is the empty sequence, returns an xs:time without a
timezone. Otherwise, returns an xs:time with a timezone.
If $timezone is not specified, then $timezone is the value of the implicit
timezone in the dynamic context.
If $arg is the empty sequence, then the result is the empty sequence.
A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or
greater than PT14H or if does not contain an integral number of minutes.
If $arg does not have a timezone component and $timezone is the empty
sequence, then the result is $arg.
If $arg does not have a timezone component and $timezone is not the empty
sequence, then the result is $arg with $timezone as the timezone component.
If $arg has a timezone component and $timezone is the empty sequence, then
the result is the localized value of $arg without its timezone component.
If $arg has a timezone component and $timezone is not the empty sequence, then:
Let $srcdt be an xs:dateTime value, with an arbitrary date for the date
component and time and timezone components that are the same as the time
and timezone components of $arg.
Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt,
$timezone)
The result of this function will be a time value that has time and timezone
components that are the same as the time and timezone components of $r.
|
Parameters:
$arg
:
The date to adjust to the new timezone.
|
$timezone
(optional):
The new timezone for the date.
|
|
Example:
Assume the dynamic context provides an implicit timezone
of -05:00 (-PT5H0M).
let $tz := xs:dayTimeDuration("-PT10H")
fn:adjust-time-to-timezone(xs:time("10:00:00"))
returns 10:00:00-05:00
fn:adjust-time-to-timezone(xs:time("10:00:00-07:00"))
returns 12:00:00-05:00
fn:adjust-time-to-timezone(xs:time("10:00:00"), $tz)
returns 10:00:00-10:00
fn:adjust-time-to-timezone(xs:time("10:00:00-07:00"), $tz)
returns 07:00:00-10:00
fn:adjust-time-to-timezone(xs:time("10:00:00"), ())
returns 10:00:00
fn:adjust-time-to-timezone(xs:time("10:00:00-07:00"), ())
returns 10:00:00
fn:adjust-time-to-timezone(
xs:time("10:00:00-07:00"),
xs:dayTimeDuration("PT10H"))
returns 03:00:00+10:00
|
|
|
|
fn:format-date(
|
|
$value as xs:date,
|
|
$picture as xs:string,
|
|
[$language as xs:string],
|
|
[$calendar as xs:string],
|
|
[$country as xs:string]
|
| ) as xs:string |
|
 |
Summary:
Returns a formatted date value based on the picture argument. This
is an XSLT function, and it is available in both XSLT and in XQuery 1.0-ml.
|
Parameters:
$value
:
The given date $value that needs to be formatted.
|
$picture
:
The desired string representation of the given date $value.
The picture string is a sequence of characters, in which the
characters represent variables such as, decimal-separator-sign,
grouping-sign, zero-digit-sign, digit-sign, pattern-separator,
percent sign and per-mille-sign. For details on the picture string, see
http://www.w3.org/TR/xslt20/#date-picture-string.
|
$language
(optional):
The desired language for string representation of the date
$value.
|
$calendar
(optional):
The only calendar supported at this point is "Gregorian" or "AD".
|
$country
(optional):
$country is used the specification to take into account country specific
string representation.
|
|
Usage Notes:
Dates before October 15, 1582 (the start of the Gregorian calendar) will
not return the correct date value.
|
Example:
fn:format-date(fn:current-date(),
"[Y01]/[M01]/[D01]")
fn:format-date(fn:current-date(),
"[Y01]/[M01]/[D01]","en","AD","US")
|
|
|
|
fn:format-dateTime(
|
|
$value as xs:dateTime,
|
|
$picture as xs:string,
|
|
[$language as xs:string],
|
|
[$calendar as xs:string],
|
|
[$country as xs:string]
|
| ) as xs:string |
|
 |
Summary:
Returns a formatted dateTime value based on the picture argument. This
is an XSLT function, and it is available in both XSLT and in XQuery 1.0-ml.
|
Parameters:
$value
:
The given dateTime $value that needs to be formatted.
|
$picture
:
The desired string representation of the given dateTime
$value.
The picture string is a sequence of characters, in which the
characters represent variables such as, decimal-separator-sign,
grouping-sign, zero-digit-sign, digit-sign, pattern-separator,
percent sign and per-mille-sign. For details on the picture string, see
http://www.w3.org/TR/xslt20/#date-picture-string.
|
$language
(optional):
The desired language for string representation of the dateTime
$value.
|
$calendar
(optional):
The only calendar supported at this point is "Gregorian" or "AD".
|
$country
(optional):
$country is used the specification to take into account country specific
string representation.
|
|
Usage Notes:
Dates before October 15, 1582 (the start of the Gregorian calendar) will
not return the correct dateTime value.
If the specified picture string includes a fractional second width that
is three or more decimal places, then the fractional seconds are truncated
(not rounded) on the third and greater width.
|
Example:
fn:format-dateTime(fn:current-dateTime(),
"[Y01]/[M01]/[D01] [H01]:[m01]:[s01]:[f01]")
fn:format-dateTime(fn:current-dateTime(),
"[Y01]/[M01]/[D01] [H01]:[m01]:[s01]:[f01]","en","AD","US")
|
|
|
|
fn:format-time(
|
|
$value as time,
|
|
$picture as xs:string,
|
|
[$language as xs:string],
|
|
[$calendar as xs:string],
|
|
[$country as xs:string]
|
| ) as xs:string |
|
 |
Summary:
Returns a formatted time value based on the picture argument. This
is an XSLT function, and it is available in both XSLT and in XQuery 1.0-ml.
|
Parameters:
$value
:
The given time $value that needs to be formatted.
|
$picture
:
The desired string representation of the given time $value.
The picture string is a sequence of characters, in which the
characters represent variables such as, decimal-separator-sign,
grouping-sign, zero-digit-sign, digit-sign, pattern-separator,
percent sign and per-mille-sign. For details on the picture string, see
http://www.w3.org/TR/xslt20/#date-picture-string.
|
$language
(optional):
The desired language for string representation of the time
$value.
|
$calendar
(optional):
The only calendar supported at this point is "Gregorian" or "AD".
|
$country
(optional):
$country is used the specification to take into account country specific
string representation.
|
|
Example:
fn:format-time(fn:current-time(),
"[H01]:[m01]:[s01]:[f01]")
fn:format-time(fn:current-time(),
"[H01]:[m01]:[s01]:[f01]","en","AD","US")
|
|
|