Removes a time zone from a time value. The time value with a time zone is localized to either the implicit time zone or to time zone specified by the argument: $dayTimeDuration-var and then the timezone indicator is removed.
If the specified time value has no time zone associated with it, then the implicit time zone is added to time value before the localization described above is done. Since the purpose of the remove-timezone-to-time function is to remove a timezone from a time value with a timezone, in most cases the passed in time value (argument: $time-var) will have a time zone, so this step will be ignored as shown in the following examples.
Note: The implicit time zone is obtained from the current environment. For example, if the time zone specified on your machine is the PSD (Pacific Daylight Savings), the implicit time zone would be -07:00.
xf:remove-timezone-from-time(xs:time $time-var) —> xs:time
xf:remove-timezone-from-time(xs:time $time-var, xf:dayTimeDuration, $dayTimeDuration-var) —> xs:time
Time zone to add to $time-var as a duration. (Optional, if not specified the implicit time zone is used). |
Returns a time without a time zone.
If $time-var does not contain a time zone and optional argument $dayTimeDuration-var is not specified, the passed in time is returned with no conversion.
The following example removes the specified time zone from the specified time value.
In this example, the passed in time value: 12:00:00Z is specified with the UTC time zone as specified by the time zone indicator: Z.
The time zone is specified with the dayTimeDuration string: -PT7H, in the preceding query which is the Pacific Daylight Savings Time (PST) time zone (-07:00).
The passed in time value: 12:00:00Z specified with the UTC time zone is localized to PST time zone and the time zone indicator (Z) is removed, as shown in the following example query:
let $timeWithUTCTimezone := xs:time("12:00:00Z") return <components> <timeWithUTCTimezone>{$timeWithUTCTimezone}</timeWithUTCTimezone> <timeWithTimeZoneAdded>{ xf:remove-timezone-from-time(xs:time($timeWithUTCTimezone), xf:dayTimeDuration("-PT7H")) }</timeWithTimeZoneAdded> </components>
The preceding query produces the following result:
<components> <timeWithUTCTimezone>12:00:00Z</timeWithUTCTimezone> <timeWithTimeZoneAdded>05:00:00</timeWithTimeZoneAdded> </components>
The following example removes the implicit time zone from the specified time value. In this example, the passed in time value: 12:00:00Z is specified with the UTC time zone as specified by the time zone indicator: Z.
In this example, the implicit time zone is assumed to be -07:00, the Pacific Daylight Savings Time (PST) time zone. (The implicit time zone is the default time zone for the current machine.)
The passed in time value: 12:00:00Z specified with the UTC time zone is localized to PST time zone and the time zone indicator (Z) is removed, as shown in the following example query:
let $timeWithUTCTimezone := xs:time("12:00:00Z") return <components> <timeWithUTCTimezone>{$timeWithUTCTimezone}</timeWithUTCTimezone> <timeWithTimeZoneAdded>{ xf:remove-timezone-from-time(xs:time($timeWithUTCTimezone)) } </timeWithTimeZoneAdded> </components>
The preceding query produces the following result:
<components> <timeWithUTCTimezone>12:00:00Z</timeWithUTCTimezone> <timeWithTimeZoneAdded>05:00:00</timeWithTimeZoneAdded> </components>
W3C remove-timezone-from-time function description.
W3C time data type description.
W3C dayTimeDuration operator description.