CopyPastor

Detecting plagiarism made easy.

Score: 0.8125818371772766; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2021-01-29
by Michael Kay

Original Post

Original - Posted on 2017-11-17
by Michael Kay



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Nearly all the date/time/timezone functionality in XSLT/XPath is based on absolute numeric timezone offset such as -05:00, not on civil timezones such as CET or America/Los_Angeles. The one exception is format-dateTime(), which is designed to format data for human consumption. The fifth argument to format-dateTime() is "place": XPath 3.1 says:
> If the $place argument is supplied in the form of an IANA timezone > name that is recognized by the implementation, then the date or time > being formatted is adjusted to the timezone offset applicable in that > timezone. For example, if the xs:dateTime value 2010-02-15T12:00:00Z > is formatted with the $place argument set to America/New_York, then > the output will be as if the value 2010-02-15T07:00:00-05:00 had been > supplied. This adjustment takes daylight savings time into account > where possible; if the date in question falls during daylight savings > time in New York, then it is adjusted to timezone offset -PT4H rather > than -PT5H. Adjustment using daylight savings time is only possible > where the value includes a date, and where the date is within the > range covered by the timezone database.
Note that this is new in XPath 3.x; the 2.0 specification only allowed a country code to be used, and was much vaguer about what it meant.
The XPath functions for manipulating timezone offsets work entirely in terms of numeric (duration) offsets, e.g UTC -5 hours or UTC +10 hours. They have no knowledge of civil timezone names or of daylight savings adjustments.
The one exception is the format-date[Time] function, where the fifth argument can be used to force conversion to the local timezone of a particular place, for example "America/New_York" - but it's somewhat implementation-defined whether such names are recognized. From the spec:
> If the $place argument is supplied in the form of an IANA timezone > name that is recognized by the implementation, then the date or time > being formatted is adjusted to the timezone offset applicable in that > timezone. For example, if the xs:dateTime value 2010-02-15T12:00:00Z > is formatted with the $place argument set to America/New_York, then > the output will be as if the value 2010-02-15T07:00:00-05:00 had been > supplied. This adjustment takes daylight savings time into account > where possible; if the date in question falls during daylight savings > time in New York, then it is adjusted to timezone offset -PT4H rather > than -PT5H. Adjustment using daylight savings time is only possible > where the value includes a date, and where the date is within the > range covered by the timezone database.

        
Present in both answers; Present only in the new answer; Present only in the old answer;