Skip to content

Commit

Permalink
[giow] (0) Define how to convert a time to a Date object if it's not …
Browse files Browse the repository at this point in the history
…a round number of milliseconds.

Affected topics: DOM APIs, HTML, Video and Audio

git-svn-id: http://svn.whatwg.org/webapps@6893 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 12, 2012
1 parent 22bec57 commit 4a37a37
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 48 deletions.
48 changes: 32 additions & 16 deletions complete.html
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 11 January 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 12 January 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -3959,6 +3959,20 @@ <h4 id=dependencies><span class=secno>2.2.2 </span>Dependencies</h4>
is passed an Infinity or Not-a-Number (NaN) value, a
<code><a href=#notsupportederror>NotSupportedError</a></code> exception must be raised.</p>

<p>When this specification requires a user agent to <dfn id=create-a-date-object>create a
<code>Date</code> object</dfn> representing a particular time, the
milliseconds component of that time, if any, must be truncated to
an integer and the time value of the newly created
<code>Date</code> object must represent the time after that
truncation.</p>

<p class=example>For instance, given the time 23045 millionths
of a second after 01:00 UTC on January 1st 2000, i.e. the time
2000-01-01T00:00:00.023045Z, then the <code>Date</code> object
created representing that time would represent the same time as
that created representing the time 2000-01-01T00:00:00.023Z, 45
millionths earlier.</p>

</dd>

<dt>Typed Arrays</dt>
Expand Down Expand Up @@ -29304,8 +29318,9 @@ <h5 id=offsets-into-the-media-resource><span class=secno>4.8.10.6 </span>Offsets
<a href=#timeline-offset>timeline offset</a> must be set to Not-a-Number (NaN).</p>

<p>The <dfn id=dom-media-startoffsettime title=dom-media-startOffsetTime><code>startOffsetTime</code></dfn>
attribute must return a new <code>Date</code> object representing
the current <a href=#timeline-offset>timeline offset</a>.</p>
attribute must return <a href=#create-a-date-object title="create a Date object">a new
<code>Date</code> object</a> representing the current
<a href=#timeline-offset>timeline offset</a>.</p>

</div>

Expand Down Expand Up @@ -44565,9 +44580,9 @@ <h6 id="date-and-time-state-(type=datetime)"><span class=secno>4.10.7.1.7 </span
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-global-date-and-time-string title="parse
a global date and time string">parsing a global date and time</a>
from <var title="">input</var> results in an error, then return an
error; otherwise, return a <code>Date</code> object representing the
parsed <a href=#concept-datetime title=concept-datetime>global date and time</a>,
expressed in UTC.</p>
error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new
<code>Date</code> object</a> representing the parsed <a href=#concept-datetime title=concept-datetime>global date and time</a>, expressed in
UTC.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -44764,9 +44779,8 @@ <h6 id="date-state-(type=date)"><span class=secno>4.10.7.1.8 </span><dfn title=a
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-date-string title="parse
a date string">parsing a date</a> from <var title="">input</var>
results in an error, then return an error; otherwise, return a
<code>Date</code> object representing midnight UTC on the morning of
the parsed <a href=#concept-date title=concept-date>date</a>.</p>
results in an error, then return an error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new <code>Date</code> object</a>
representing midnight UTC on the morning of the parsed <a href=#concept-date title=concept-date>date</a>.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -44921,8 +44935,9 @@ <h6 id="month-state-(type=month)"><span class=secno>4.10.7.1.9 </span><dfn title
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-month-string title="parse
a month string">parsing a month</a> from <var title="">input</var> results in an error, then return an error;
otherwise, return a <code>Date</code> object representing midnight
UTC on the morning of the first day of the parsed <a href=#concept-month title=concept-month>month</a>.</p>
otherwise, return <a href=#create-a-date-object title="create a Date object">a new
<code>Date</code> object</a> representing midnight UTC on the
morning of the first day of the parsed <a href=#concept-month title=concept-month>month</a>.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -45074,9 +45089,9 @@ <h6 id="week-state-(type=week)"><span class=secno>4.10.7.1.10 </span><dfn title=
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-week-string title="parse
a week string">parsing a week</a> from <var title="">input</var>
results in an error, then return an error; otherwise, return a
<code>Date</code> object representing midnight UTC on the morning of
the Monday of the parsed <a href=#concept-week title=concept-week>week</a>.</p>
results in an error, then return an error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new <code>Date</code> object</a>
representing midnight UTC on the morning of the Monday of the parsed
<a href=#concept-week title=concept-week>week</a>.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -45227,8 +45242,9 @@ <h6 id="time-state-(type=time)"><span class=secno>4.10.7.1.11 </span><dfn title=
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-time-string title="parse
a time string">parsing a time</a> from <var title="">input</var>
results in an error, then return an error; otherwise, return a
<code>Date</code> object representing the parsed <a href=#concept-time title=concept-time>time</a> in UTC on 1970-01-01.</p>
results in an error, then return an error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new <code>Date</code> object</a>
representing the parsed <a href=#concept-time title=concept-time>time</a> in
UTC on 1970-01-01.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down
48 changes: 32 additions & 16 deletions index
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 11 January 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 12 January 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -3959,6 +3959,20 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
is passed an Infinity or Not-a-Number (NaN) value, a
<code><a href=#notsupportederror>NotSupportedError</a></code> exception must be raised.</p>

<p>When this specification requires a user agent to <dfn id=create-a-date-object>create a
<code>Date</code> object</dfn> representing a particular time, the
milliseconds component of that time, if any, must be truncated to
an integer and the time value of the newly created
<code>Date</code> object must represent the time after that
truncation.</p>

<p class=example>For instance, given the time 23045 millionths
of a second after 01:00 UTC on January 1st 2000, i.e. the time
2000-01-01T00:00:00.023045Z, then the <code>Date</code> object
created representing that time would represent the same time as
that created representing the time 2000-01-01T00:00:00.023Z, 45
millionths earlier.</p>

</dd>

<dt>Typed Arrays</dt>
Expand Down Expand Up @@ -29304,8 +29318,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<a href=#timeline-offset>timeline offset</a> must be set to Not-a-Number (NaN).</p>

<p>The <dfn id=dom-media-startoffsettime title=dom-media-startOffsetTime><code>startOffsetTime</code></dfn>
attribute must return a new <code>Date</code> object representing
the current <a href=#timeline-offset>timeline offset</a>.</p>
attribute must return <a href=#create-a-date-object title="create a Date object">a new
<code>Date</code> object</a> representing the current
<a href=#timeline-offset>timeline offset</a>.</p>

</div>

Expand Down Expand Up @@ -44565,9 +44580,9 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-global-date-and-time-string title="parse
a global date and time string">parsing a global date and time</a>
from <var title="">input</var> results in an error, then return an
error; otherwise, return a <code>Date</code> object representing the
parsed <a href=#concept-datetime title=concept-datetime>global date and time</a>,
expressed in UTC.</p>
error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new
<code>Date</code> object</a> representing the parsed <a href=#concept-datetime title=concept-datetime>global date and time</a>, expressed in
UTC.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -44764,9 +44779,8 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-date-string title="parse
a date string">parsing a date</a> from <var title="">input</var>
results in an error, then return an error; otherwise, return a
<code>Date</code> object representing midnight UTC on the morning of
the parsed <a href=#concept-date title=concept-date>date</a>.</p>
results in an error, then return an error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new <code>Date</code> object</a>
representing midnight UTC on the morning of the parsed <a href=#concept-date title=concept-date>date</a>.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -44921,8 +44935,9 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-month-string title="parse
a month string">parsing a month</a> from <var title="">input</var> results in an error, then return an error;
otherwise, return a <code>Date</code> object representing midnight
UTC on the morning of the first day of the parsed <a href=#concept-month title=concept-month>month</a>.</p>
otherwise, return <a href=#create-a-date-object title="create a Date object">a new
<code>Date</code> object</a> representing midnight UTC on the
morning of the first day of the parsed <a href=#concept-month title=concept-month>month</a>.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -45074,9 +45089,9 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-week-string title="parse
a week string">parsing a week</a> from <var title="">input</var>
results in an error, then return an error; otherwise, return a
<code>Date</code> object representing midnight UTC on the morning of
the Monday of the parsed <a href=#concept-week title=concept-week>week</a>.</p>
results in an error, then return an error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new <code>Date</code> object</a>
representing midnight UTC on the morning of the Monday of the parsed
<a href=#concept-week title=concept-week>week</a>.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down Expand Up @@ -45227,8 +45242,9 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href=#parse-a-time-string title="parse
a time string">parsing a time</a> from <var title="">input</var>
results in an error, then return an error; otherwise, return a
<code>Date</code> object representing the parsed <a href=#concept-time title=concept-time>time</a> in UTC on 1970-01-01.</p>
results in an error, then return an error; otherwise, return <a href=#create-a-date-object title="create a Date object">a new <code>Date</code> object</a>
representing the parsed <a href=#concept-time title=concept-time>time</a> in
UTC on 1970-01-01.</p>

<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
Expand Down

0 comments on commit 4a37a37

Please sign in to comment.