comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
To: comp.lang.ada@ada-france.org
Subject: Re: GWindows Database time type
Date: 30 Sep 2004 20:57:16 -0400
Date: 2004-09-30T20:57:16-04:00	[thread overview]
Message-ID: <mailman.142.1096592260.390.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <kf0nl0d91e32fhcd29ua256pq23hfj1cbj@4ax.com>

Fionn mac Cuimhaill <invisible@hiding.from.spam> writes:

> On 29 Sep 2004 20:13:23 -0400, Stephen Leake <stephen_leake@acm.org>
> wrote:
> 
> >Fionn mac Cuimhaill <invisible@hiding.from.spam> writes:
> >
> >> On another front - the proposed bug list. I have an item for it.
> >> This might be described as a restriction rather than a bug; this is in
> >> GWindows.Databases. I was using one of the Field_Value functions to
> >> get a SQL Server datetime value into a variable of type Time (as
> >> defined in Ada.Calendar).  The problem is that the range of dates that
> >> can be expressed with a variable of type Time is too narrow, and one
> >> of the GNATCOM routines which converts the date extracted from SQL
> >> Server into a Time choked on a date with a year before 1901.
> >> 
> >> GNATCOM and GWindows need a calendar package similar to Ada.Calendar
> >> which is based on a native Windows time representation.
> >
> >Native Windows might be the wrong choice; databases are hosted on many
> >operating systems, and GWindows should be able to provide clients for
> >any of them, possibly thru ODBC.
> >
> >Here's a fragment from the MySQL manual
> >(http://dev.mysql.com/doc/mysql/en/TIME.html):
> >
> >MySQL retrieves and displays TIME values in 'HH:MM:SS' format (or
> >'HHH:MM:SS' format for large hours values). TIME values may range from
> >'-838:59:59' to '838:59:59'.
> >
> >For that, Time needs to be a string; that will always be the most
> >general format.
> >
> It's difficult to do tate arithmetic on strings; 

Well, yes. But nothing says the type stored in the database has to be
the type you use to do date arithmetic.

> Windows already has a SYSTEMTIME structure that is used in GNATCOM;
> there is also a 64-bit integer representation of time. According to
> Microsoft docs, SYSTEMTIME accomodates years all the way back to
> 1601. I'm not sure what the 64-bit integer represents. (milliseconds
> since Jan 1, 1601???) 

I think that is the start of the Gregorian calendar, or something like
that. 

> I have no idea of the reason for the 1601 date; in any case, it is a
> great improvement over the 1901 limiting date used in Ada.Calendar.
> There is no reason why a GWindows.Calendar package couldn't be
> created that makes use of the SYSTEMTIME structure and also supports
> a date representation usable for date arithmetic. 

We could, but I would object to calling it Calendar; that's sort of a
reserved name in Ada. There are many other, equally good, ways to
build a date package. Hmm. I suppose if we accept up front that
GWindows is very Win32 based, it's not such a bad name.

Windex has a binding to Win32 system time and file time types.

> It looks to me like David Botton went with Ada.Calendar because it
> was an already existing standard package, which if not perfect, was
> at least usable and saved him the time of writing a calendar
> package. 

Yes. The consensus is that each user should write the time/date
package they need. For my real-time simulations, I use a 64 bit fixed
point time, with a resolution of nanoseconds and a range of 242 years.

> The native Windows time formats certainly cover a wide enough range of
> dates to work better than Ada.Calendar. There doesn't seem to be any
> element of GWindows which actually parses SQL; SQL code is managed
> entirely by the programmer, and therefore any dialect of SQL can be
> used. It wouldn't be too difficult to create a GWindows.Calendar that
> could handle dates from any kind of database.

Well, I still don't see why the design of GWindows.Calendar should be
at all influenced by databases; let's keep things orthogonal as much
as possible.

-- 
-- Stephe




  reply	other threads:[~2004-10-01  0:57 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29  2:48 GWindows and a future home for it Fionn mac Cuimhaill
2004-09-29  2:53 ` stephane richard
2004-09-29  7:20   ` Martin Krischik
2004-09-29 12:40 ` Chris Humphries
2004-09-29 15:21   ` stephane richard
2004-09-29 19:12     ` Chris Humphries
2004-09-30  0:03 ` Stephen Leake
2004-09-30  1:39   ` stephane richard
2004-09-30  3:29   ` Fionn mac Cuimhaill
     [not found]     ` <mailman.141.1096581654.390.comp.lang.ada@ada-france.org>
2004-09-30 23:32       ` Randy Brukardt
2004-10-01  1:28     ` Stephen Leake
2004-10-01  1:39       ` stephane richard
2004-10-01  6:43       ` Fionn mac Cuimhaill
     [not found]     ` <umzz75se6.fsf@acm.org>
2004-10-01 10:48       ` Marius Amado Alves
2004-10-01 14:49         ` Fionn mac Cuimhaill
2004-10-01 15:39           ` Marius Amado Alves
2004-10-01 15:50             ` stephane richard
2004-10-01 16:25               ` Chris Humphries
2004-10-01 17:09                 ` Ludovic Brenta
2004-10-21 17:12                   ` Warren W. Gay VE3WWG
2004-10-21 18:02                     ` Coupling or not coupling database and GUI libraries (was: GWindows and a future home for it) Ludovic Brenta
2004-10-21 21:11                       ` Coupling or not coupling database and GUI libraries Warren W. Gay VE3WWG
2004-10-22  2:36                       ` Coupling or not coupling database and GUI libraries (was: GWindows and a future home for it) David Botton
2004-10-02  2:01             ` GWindows and a future home for it Fionn mac Cuimhaill
2004-09-30 14:40   ` Nick Roberts
2004-09-30 15:22     ` stephane richard
2004-10-01 19:52       ` Nick Roberts
2004-09-30 16:55     ` tmoran
2004-09-30 22:17   ` Stephen McNeill
2004-09-30 22:48     ` stephane richard
2004-10-01 16:34   ` Björn Persson
2004-10-01 16:58   ` AndreS
2004-10-01 18:08     ` Georg Bauhaus
2004-10-01 18:16       ` Randy Brukardt
2004-10-01 23:20         ` tmoran
2004-10-02  0:45         ` Jeffrey Carter
2004-10-03 17:23           ` David Botton
2004-10-04 22:10         ` Randy Brukardt
2004-10-01 18:40       ` Marius Amado Alves
2004-10-03 22:45         ` Georg Bauhaus
2004-10-04 13:01           ` Marius Amado Alves
2004-10-04 21:05             ` Ludovic Brenta
2004-10-06 10:13               ` Marius Amado Alves
2004-10-06 13:15                 ` David Botton
2004-10-06 14:35                   ` Marius Amado Alves
2004-10-06 15:07                     ` Hyman Rosen
2004-10-06 17:04                       ` Marius Amado Alves
2004-10-06 17:53                         ` Licenses and physical things Björn Persson
2004-10-06 18:02                         ` GWindows and a future home for it Hyman Rosen
2004-10-06 18:39                           ` Marius Amado Alves
2004-10-06 18:58                         ` Georg Bauhaus
2004-10-06 19:20                           ` Marius Amado Alves
2004-10-06 20:30                             ` Hyman Rosen
2004-10-06 21:28                               ` Marius Amado Alves
2004-10-06 21:40                                 ` Hyman Rosen
2004-10-07 11:50                     ` Marin David Condic
2004-10-07 14:33                       ` Georg Bauhaus
2004-10-06 13:19                 ` Gnat Pro and the GPL Björn Persson
2004-10-06 17:16                   ` Marius Amado Alves
2004-10-06 17:55                     ` Björn Persson
2004-10-06 18:18                       ` Marius Amado Alves
2004-10-06 19:02                         ` Hyman Rosen
2004-10-06 20:25                           ` Björn Persson
2004-10-07  6:07                             ` Florian Weimer
2004-10-07 16:00                               ` Björn Persson
2004-10-06 22:21                         ` CBFalconer
2004-10-06 18:04                     ` Hyman Rosen
     [not found]               ` <4163C54F.9050700@netcabo.pt>
2004-10-07  0:27                 ` GWindows and a future home for it Stephen Leake
2004-10-07  0:55                   ` stephane richard
2004-10-07 19:11                     ` Not redistributing GNAT Pro (was: GWindows and a home for it) Ludovic Brenta
2004-10-08  2:07                       ` Jeff C r e e.m
2004-10-08 16:50                         ` Not redistributing GNAT Pro Ludovic Brenta
2004-10-08 17:26                           ` Jeff C r e e.m
2004-10-09  2:27                           ` Brian May
2004-10-09 11:14                             ` Ludovic Brenta
2004-10-09  5:16                           ` CBFalconer
2004-10-09  9:57                             ` Jerry van Dijk
2004-10-08  5:53                       ` Not redistributing GNAT Pro (was: GWindows and a home for it) Simon Wright
2004-10-01 23:57     ` GWindows and a future home for it Stephen Leake
2004-10-02  3:06     ` Fionn mac Cuimhaill
2004-10-02  7:13       ` tmoran
2004-10-03 16:22         ` James E. Hopper
2004-10-03 19:03         ` Future of Ada volunteer efforts David Botton
2004-10-03 23:31           ` stephane richard
2004-09-30  0:13 ` GWindows Database time type Stephen Leake
2004-09-30  4:31   ` Fionn mac Cuimhaill
2004-10-01  0:57     ` Stephen Leake [this message]
2004-10-01  1:44       ` stephane richard
2004-10-01  3:04         ` Randy Brukardt
2004-10-01 10:07           ` stephane richard
2004-09-30 18:44   ` Georg Bauhaus
2004-10-21 17:29     ` Warren W. Gay VE3WWG
2004-10-22  2:32       ` David Botton
2004-10-22 16:46         ` Warren W. Gay VE3WWG
2004-10-21 17:26   ` Warren W. Gay VE3WWG
2004-10-03 15:41 ` AdaPower and GWindows community effort drive David Botton
2004-10-03 16:45   ` stephane richard
2004-10-03 17:29     ` David Botton
2004-10-03 17:38       ` stephane richard
2004-10-03 19:10         ` David Botton
2004-10-04  2:12       ` Stephen Leake
2004-10-04  2:21         ` stephane richard
2004-10-04 13:25         ` David Botton
2004-10-04  2:37   ` Fionn mac Cuimhaill
2004-10-04  2:49     ` stephane richard
2004-10-04 13:44     ` David Botton
2004-10-05  1:25       ` David Botton
replies disabled

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