From: Garrett Smith on
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
>
>> XML Schema[1] States:
>> Note:
>> | The date and time datatypes described in this recommendation were
>> | inspired by [ISO 8601]. '0001' is the lexical representation of the
>> | year 1 of the Common Era (1 CE, sometimes written "AD 1" or "1 AD").
>> | There is no year 0, and '0000' is not a valid lexical representation.
>> | '-0001' is the lexical representation of the year 1 Before Common Era
>> | (1 BCE, sometimes written "1 BC").
>> [...]
>>
>> | [ISO 8601] makes no mention of the year 0; in [ISO 8601:1998 Draft
>> | Revision] the form '0000' was disallowed and this recommendation
>> | disallows it as well.
>>
>> That would mean that year 1 BC, as written 0000 in ISO8601:2000
>> and ISO8601:2004(E) is written -0001.
>>
>> That's a bug in the XML Schema spec.
>
> It evidently isn't:

XML Schema states:

"[ISO 8601] makes no mention of the year 0;"

That is wrong; ISO8601:2000 explicitly mentions 0000.

ISO8601:2004(E)
| 4.1.2.1 General
| In expressions of calendar dates
|
| calendar year is, unless specified otherwise, represented by four
| digits. Calendar years are numbered in ascending order according to
| the Gregorian calendar by values in the range [0000] to [9999]. Values
| in the range [0000] through [1582]

ISO8601:2000
| 5.2.1 Calendar date
|
| ...year is generally represented by four digits; years are numbered in
| ascending order according to the Gregorian calendar by values in the
| range [0000] to [9999]. ...

>> Perhaps a small note at the bottom of that entry:
>> Year 0000 is not recognized by XML Schema or xs:date.
>
> Works as designed.
>
> However, I wonder what all of this has to do with ECMAScript, let alone the
> FAQ entry. That said, I find it pretty silly to restrict the interpretation
> of YYYY to a decimal four-digit display. In all applications I know, it
> means four or more decimal digits so that the century of the year, according
> to the Gregorian Calendar, is accurately represented. I thought we had
> learned something from the Y2K bug, but apparently not. Incidentally, in
> printf-based date formatting, which I prefer, `%Y' represents the full year
> (including the full century).

There is some value in mentioning that XML Schema deviates from ISO8601,
and also in linking to that. Does it add extra clutter?

The reason given for XML Schema disallowing year 0 is that ISO8601 does
not mention year 0, but that is false. Looks like somebody fucked up.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
From: Garrett Smith on
Hans-Georg Michna wrote:
> On Thu, 08 Oct 2009 22:00:44 -0700, Garrett Smith wrote:
>
>> In context of a javascript FAQ, capitalized "Date" seems obvious to me.
>> Are there others who feel it is confusing?
>
> I did understand the capitalized Date, but I admit that I also
> stumbled over the slight potential for misunderstanding.
>
> I guess this cannot be argued very well, because the perception
> varies. I don't think this discussion will lead anywhere.
>
Fine. "Date object" it is.

--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
From: Hans-Georg Michna on
On Mon, 19 Oct 2009 19:07:29 -0700, Garrett Smith wrote:

>The reason given for XML Schema disallowing year 0 is that ISO8601 does
>not mention year 0, but that is false. Looks like somebody fucked up.

Somebody fucked up anyway. The definition of the calendar
predates computers by many years. I suspect that a combination
of ignorance and arrogance led some programmers or standards
committee members as far astray as to try to redefine and shift
the year numbers. Not untypical, unfortunately.

In any case we have to live with it now.

Hans-Georg
From: Johannes Baagoe on
Garrett Smith :

> XML Schema[1] States: Note: | The date and time datatypes described
> in this recommendation were | inspired by [ISO 8601]. '0001'
> is the lexical representation of the | year 1 of the Common Era
> (1 CE, sometimes written "AD 1" or "1 AD"). | There is no year 0,
> and '0000' is not a valid lexical representation. | '-0001' is the
> lexical representation of the year 1 Before Common Era | (1 BCE,
> sometimes written "1 BC"). [...]

> | [ISO 8601] makes no mention of the year 0; in [ISO 8601:1998 Draft
> | Revision] the form '0000' was disallowed and this recommendation |
> disallows it as well.

> That would mean that year 1 BC, as written 0000 in ISO8601:2000 and
> ISO8601:2004(E) is written -0001.

> That's a bug in the XML Schema spec.

Or a different solution reached at a time where ISO 8601 was
still unclear about the matter. It is debatable which evil is the
lesser, between disallowing year 0 and subtracting one year from
straightforward calculations of intervals between dates before and
after the epoch, or rendering 44 BC as "-0043", 404 BC as "-0403", etc.
Historians may be willing enough to put in a leading minus sign
and a few zeros in the name of progress, but an offset of one in the
dates with which they are familiar is bound to be met with protests.

In any case, it creates an unfortunate inconsistency.

> The entry mentions ISO 8601 and links to ISO8601:2004(E). Is
> mentioning a different representation range for XML Schema important?

It depends on how many readers are going to use javascript client-side
in order to interact with XML databases server-side. It happens to
be of paramount importance to me, but it is hardly the case for most of
the intended audience of the FAQ. At least, for the time being.

> Perhaps a small note at the bottom of that entry: Year 0000 is not
> recognized by XML Schema or xs:date.

That is fine with me.

--
Johannes
From: Thomas 'PointedEars' Lahn on
Garrett Smith wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>> XML Schema[1] States:
>>> Note:
>>> | The date and time datatypes described in this recommendation were
>>> | inspired by [ISO 8601]. '0001' is the lexical representation of the
>>> | year 1 of the Common Era (1 CE, sometimes written "AD 1" or "1 AD").
>>> | There is no year 0, and '0000' is not a valid lexical representation.
>>> | '-0001' is the lexical representation of the year 1 Before Common Era
>>> | (1 BCE, sometimes written "1 BC").
>>> [...]
>>>
>>> | [ISO 8601] makes no mention of the year 0; in [ISO 8601:1998 Draft
>>> | Revision] the form '0000' was disallowed and this recommendation
>>> | disallows it as well.
>>>
>>> That would mean that year 1 BC, as written 0000 in ISO8601:2000
>>> and ISO8601:2004(E) is written -0001.
>>>
>>> That's a bug in the XML Schema spec.
>>
>> It evidently isn't:
>
> XML Schema states:
>
> "[ISO 8601] makes no mention of the year 0;"
>
> That is wrong; ISO8601:2000 explicitly mentions 0000.

But `[ISO 8601]' does not refer to ISO8601:2000 there, does it?

> ISO8601:2004(E)
> [...]
> ISO8601:2000

Irrelevant to show the veracity of the statement above. You have not quoted
the most relevant part:

| [...] in [ISO 8601:1998 Draft Revision] the form '0000' was disallowed and
| this recommendation disallows it as well. However, [ISO 8601:2000 Second
| Edition], which became available just as we were completing version 1.0,
| allows the form '0000', representing the year 1 BCE. [...]

> [...]
> There is some value in mentioning that XML Schema deviates from ISO8601,
> and also in linking to that. Does it add extra clutter?

Are you writing an XML Schema FAQ? Has this NG "xml" in its name?

> The reason given for XML Schema disallowing year 0 is that ISO8601 does
> not mention year 0,

No, it is not. You misunderstand
<http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>, section 3.2.7,
and ignore
<http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#deviantformats>.

> but that is false.

Non sequitur.

> Looks like somebody fucked up.

Yes; *you* did. And unless the subject is going to be something JS/ES-
related again, it's EOD for me.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Prev: Computer Techs Wanted
Next: move div by drag etc.