This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5309 - [XSLT 2.0] format-dateTime() component specified "z"
Summary: [XSLT 2.0] format-dateTime() component specified "z"
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-09 21:07 UTC by Michael Kay
Modified: 2008-07-11 13:51 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2007-12-09 21:07:59 UTC
We publish inconsistent examples for the expected output from component specifier "z". Both "GMT+1" and "GMT+02:00" are suggested as possible output. We need to give clearer guidance as to what is expected (or what degrees of freedom are available). Perhaps the choice between the two example formats should depend on the rest of the format specifier.

This bug is raised in (inexcusably delayed!) response to internal bug 709 raised against test case dateformat015. See

http://www.w3.org/Member/bugzilla/show_bug.cgi?id=709

(member-only link)
Comment 1 Michael Kay 2008-02-07 16:54:43 UTC
It's interesting to note that

http://wwp.greenwichmeantime.com/time-zone/gmt+1/

uses both GMT+1 and GMT+01:00 on the same page. The +1 form appears to be the more popular, as far as I can tell. I'd suggest that the choice should be based on the width specifier.
Comment 2 Anders Berglund 2008-03-12 14:32:21 UTC
Proposal for clarifying the current text:

Examples of specifications:

[z] (defaults to [z1]):  GMT+1, GMT+10, GMT+5:30

[z01]: GMT+01, GMT+10, GMT+5:30

[z,6-6] (defaults to [z1,6-6] and equivalent to [z01,6-6]):
       GMT+01:00, GMT+10:00, GMT+05:30

Additions to the existing text (existing text in []):

[If the minumum and maximum width are unspecified, then the
output uses as many characters as are required to represent
the value of the component without truncation and without
padding: this is referred to below as the full representation
of the value.] For a time offset the full representation of the
value consists of the sign for the offset, the number of hours
of the offset, and if the offset is not an integral number of hours
a ":" followed by the two digits of the minutes of the offset.

...

[If the full representation of the value is shorter than the
specified minimum width, then the processor should pad the value
to the specified width. For decimal representations of numbers,
this should be done by prepending zero digits from the appropriate
set of digit characters, or appending zero digits in the case of
the fractional seconds component.]
For time offsets this should be done by appending a ":" followed by two
zero digits from the appropriate set of digit characters if the full
representation does not already include a minutes component and if
the specified minimum width permits adding three characters,
otherwise this should be done by prepending zero digits from the
appropriate set of digit characters to the hour component.
[In other cases, it should be done by appending spaces.]

The GMT examples in the table need correcting to use [z,6-6]
rather than [z]. We should also add an example resulting in GMT+2.
Comment 3 Michael Kay 2008-07-10 16:24:02 UTC
According to the minutes, this proposal was accepted by the WG and will be turned into an erratum.
Comment 4 Michael Kay 2008-07-11 13:51:05 UTC
The proposal in comment #2 has been implemented (with slight editorial variation) in Erratum E24.