comp.lang.ada
 help / color / mirror / Atom feed
From: brian.b.mcguinness@lmco.com
Subject: Re: Advice on Calendar.Time
Date: 9 Nov 2005 11:37:44 -0800
Date: 2005-11-09T11:37:44-08:00	[thread overview]
Message-ID: <1131565063.972303.313350@g44g2000cwa.googlegroups.com> (raw)
In-Reply-To: <1131465873.702910.143400@g43g2000cwa.googlegroups.com>

So one approach would be to use Ada.Calendar.Time_Zones as Martin
suggested, e.g. get
the time of day from Clock, using Split to divide it into year, month,
day, and second, then get the time offset (in minutes) from
UTC_Time_Offset, and convert to GMT accordingly.  But the question
remains of how to deal with leap seconds.  (And why does
UTC_Time_Offset return a value in minutes rather than seconds, which
would make it more compatible with Split?)

Astronomers face a similar problem in converting conventional dates and
times to the Julian day number, the number of days since 00:00 GMT on
January 1, 4713 B.C.  They have software to keep track of leap seconds
and so on.  So you might find something useful in a package of
astronomical subroutines such as SOFA, which is at
http://www.iau-sofa.rl.ac.uk/
(this is in Fortran, not Ada, but it could probably be translated
without too much trouble or Fortran routines might be linked into an
Ada program).

Good luck.

--- Brian




  parent reply	other threads:[~2005-11-09 19:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-08 16:04 Advice on Calendar.Time REH
2005-11-08 17:09 ` Larry Kilgallen
2005-11-08 17:30   ` REH
2005-11-08 17:59   ` Wilhelm Spickermann
2005-11-08 18:38     ` REH
2005-11-08 19:29       ` Martin Dowie
2005-11-08 20:05         ` REH
2005-11-08 22:00           ` Martin Dowie
2005-11-08 23:02             ` REH
2005-11-08 22:09           ` Wilhelm Spickermann
2005-11-08 22:13             ` REH
2005-11-09  5:23               ` Wilhelm Spickermann
2005-11-09  7:00               ` Martin Dowie
2005-11-09  3:16       ` Jeffrey R. Carter
2005-11-09  1:36   ` Keith Thompson
2005-11-13 14:15     ` Jacob Sparre Andersen
2005-11-13 21:37       ` Keith Thompson
2005-11-09  0:23 ` Stephen Leake
2005-11-09  8:32 ` Dmitry A. Kazakov
2005-11-09 19:37 ` brian.b.mcguinness [this message]
2005-11-09 21:45   ` brian.b.mcguinness
2005-12-01  0:24   ` Randy Brukardt
replies disabled

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