<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>1211</bug_id>
          
          <creation_ts>2005-04-05 10:15:18 +0000</creation_ts>
          <short_desc>[F&amp;O] Midnight (24:00:00)</short_desc>
          <delta_ts>2005-09-29 10:39:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Ashok Malhotra">ashok.malhotra</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3803</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-04-05 10:15:18 +0000</bug_when>
    <thetext>Section 10.4 needs to discuss how midnight (24:00:00) is handled.

I believe the correct treatment is that when filling in values from the
reference date time, the value 24:00:00 is considered to be the same as 00:00:00
on the following day. Thus if the reference date is 1972-12-31, the time
24:00:00 expands to 1973-01-01T00:00:00, with the consequence that 24:00:00 and
00:00:00 are not equal. But the dateTimes 2005-04-04T24:00:00 and
2005:04-05:00:00:00 *are* equal.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3633</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-04-27 21:31:24 +0000</bug_when>
    <thetext>Please see a more extended discussion of the topic and a detailed proposal at

http://lists.w3.org/Archives/Member/w3c-xsl-query/2005Apr/0053.html

(Member-only)

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3379</commentid>
    <comment_count>2</comment_count>
    <who name="Ashok Malhotra">ashok.malhotra</who>
    <bug_when>2005-05-11 15:30:00 +0000</bug_when>
    <thetext>The WGS decided on 5-10-2005 to accept Mike Kay&apos;s proposal in
http://lists.w3.org/Archives/Member/w3c-xsl-query/2005May/0004.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3382</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Cotton">pcotton</who>
    <bug_when>2005-05-11 19:15:12 +0000</bug_when>
    <thetext>Since the URL given was member-only here is the details of the adopted 
proposal:

===
So here are the changes
we need to make for the alternative proposal, which makes it represent the
start of the day when used as a time, but the end of the day when used in a
dateTime. This mainly consists of examples to alert people to the possible
surprises that this causes.

In the data model, add a note to 3.3.2 that the lexical representation
&quot;24:00:00&quot; maps to the value (0,0,0), while 1999-12-31T24:00:00 maps to the
value (2000, 1, 1, 0, 0, 0).

In F+O:

Section 5.2. Add two examples:

fn:dateTime(xs:date(&quot;1999-12-31&quot;), xs:time(&quot;12:00:00&quot;)) =&gt;
xs:dateTime(&quot;1999-12-31T12:00:00&quot;)
fn:dateTime(xs:date(&quot;1999-12-31&quot;), xs:time(&quot;24:00:00&quot;)) =&gt;
xs:dateTime(&quot;1999-12-31T00:00:00&quot;)

with perhaps a word of explanation.

Section 10.1: explain in the text or by examples that the lexical
representation &quot;24:00:00&quot; maps to the value (0,0,0), while
1999-12-31T24:00:00 maps to the value (2000, 1, 1, 0, 0, 0).

In 10.4, to the paragraph starting &quot;The starting instant of an occurrence of
a date/time value is an xs:dateTime calculated by filling in the missing
components...&quot; add: &quot;If the xs:time value written as
24:00:00 is to be compared, filling in the missing components gives
1972-12-31T00:00:00, because 24:00:00 is treated as being simply an
alternative representation of 00:00:00 (the lexical value 24:00:00 is
converted to the components (0,0,0) before the missing components are filled
in). This has the consequence that when ordering xs:time values, 24:00:00 is
considered to be earlier than 23:59:59. However, when ordering xs:dateTime
values, a time of 24:00:00 is considered equivalent to 00:00:00 on the
following day.&quot;

Section 10.4.7.1: add the examples

op:dateTime-equal(xs:dateTime(&quot;1999-12-31T24:00:00&quot;),
xs:dateTime(&quot;2000-01-01T00:00:00&quot;)) returns true
op:dateTime-equal(xs:dateTime(&quot;2005-04-04T24:00:00&quot;),
xs:dateTime(&quot;2005-04-04T00:00:00&quot;)) returns false

Section 10.4.13: add the example

op:time-equal(xs:time(&quot;24:00:00+01:00&quot;), xs:time(&quot;00:00:00+01:00&quot;)) returns
true

Section 10.4.14: add the example

op:time-less-than(xs:time(&quot;23:59:59&quot;), xs:time(&quot;24:00:00&quot;)) return false

Section 10.5.7: add the example

fn:year-from-dateTime(xs:dateTime(&quot;1999-12-31T24:00:00&quot;)) returns 2000

Section 10.5.10: add the example

fn:hours-from-dateTime(xs:dateTime(&quot;1999-12-31T24:00:00&quot;)) returns 0

Section 10.5.18: add the example

fn:hours-from-time(xs:time(&quot;24:00:00&quot;)) returns 0

Section 10.8.3: add the example

op:subtract-times(xs:time(&quot;24:00:00&quot;), xs:time(&quot;23:59:59&quot;)) returns
xdt:dayTimeDuration(&quot;-PT23H59M59S&quot;), with an explanation as with the other
examples.

Section 17.1.2, to the paragraph starting &quot;If ST is xs:dateTime, xs:date or
xs:time, ...&quot; add &quot;Note that the hours component of the resulting string
will never be 24. Midnight is always represented as &quot;00:00:00&quot;.
===
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>