comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert C. Leif" <rleif@rleif.com>
Subject: RE: Timetype
Date: Fri, 28 Jun 2002 16:51:44 -0700
Date: 2002-06-28T16:51:44-07:00	[thread overview]
Message-ID: <mailman.1025308382.8853.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <3D1BF397.CC974E8E@attbi.com>

From: Bob Leif
To: Mark Biggar et al.
XML data types includes the Gregorian Calendar. A package
XML_IO.Calendar might be a solution. 
XML Schema Part 2: Datatypes
W3C Recommendation 02 May 2001
http://www.w3.org/TR/xmlschema-2/

3.2 Primitive datatypes
3.2.1 string 
3.2.2 boolean 
3.2.3 decimal 
3.2.4 float 
3.2.5 double 
3.2.6 duration 
3.2.7 dateTime 
3.2.8 time 
3.2.9 date 
3.2.10 gYearMonth 
3.2.11 gYear 
3.2.12 gMonthDay 
3.2.13 gDay 
3.2.14 gMonth 
3.2.15 hexBinary 
3.2.16 base64Binary 
3.2.17 anyURI 
3.2.18 QName 
3.2.19 NOTATION

The Sun DEVELOPER CONNECTION page shows
Sun[tm] XML Datatypes Library in JAVA 
Product Version: Preview Version 2.1
Release Date: April, 2002
System Requirements: JDK 1.3
Developer Name: Kohsuke Kawaguchi
File Name: xsdlib.20020414.zip   Size: 529K
http://wwws.sun.com/software/xml/developers/xsdlib2/

I have not looked at this because I have no interest in JAVA. However. I
am curious on how the XML enumerated types were mapped to JAVA.



-----Original Message-----
From: comp.lang.ada-admin@ada.eu.org
[mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of Mark Biggar
Sent: Thursday, June 27, 2002 10:26 PM
To: comp.lang.ada@ada.eu.org
Subject: Re: Timetype

Björn Lundin wrote:
> 
> Hello1
> Can anyone explain this to me?
> 
> cut from a-calend.ads
> --  Declarations representing limits of allowed local time values.
Note that
> --  these do NOT constrain the possible stored values of time which
may well
> --  permit a larger range of times (this is explicitly allowed in Ada
95).
> 
>    subtype Year_Number  is Integer range 1901 .. 2099;
> 
> Does it mean that i can write an application dealing with historical
dates
> using the time_type?
> 
> It seems to me that a date like 05-Jun-1712 would cause
> constraint_error.
> 
> Does anyone know the reason for this small range of years in
> the timetype?

Yes, this range allows using the expression (year mod 4 = 0) to test
test for leap years. BTW taking your example date, which one do you
mean?  There is a 11 day difference between 05-jun-1712 in England and 
its colonies and that date in most of Europe.  England didn't convert
to the Gregorian calendar until 1752, while most of Catholic europe
converted in the 1500's.  Russia didn't convert until the 1920's, so
even Ada's year range can cause problems with historical dates. The
standard writers didn't want to deal with the mess that the calendar 
is in.

--
Mark Biggar
mark.a.biggar@attbi.com




  parent reply	other threads:[~2002-06-28 23:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-27 20:31 Timetype Björn Lundin
2002-06-27 21:03 ` Timetype David C. Hoos
2002-06-28  5:26 ` Timetype Mark Biggar
2002-06-28 13:47   ` Timetype Marin David Condic
2002-06-28 17:12   ` Timetype Björn Lundin
2002-06-28 23:51   ` Robert C. Leif [this message]
2002-06-28 12:53 ` Timetype Jacob Sparre Andersen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox