From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cb2591a9113d8ee6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g44g2000cwa.googlegroups.com!not-for-mail From: brian.b.mcguinness@lmco.com Newsgroups: comp.lang.ada Subject: Re: Advice on Calendar.Time Date: 9 Nov 2005 11:37:44 -0800 Organization: http://groups.google.com Message-ID: <1131565063.972303.313350@g44g2000cwa.googlegroups.com> References: <1131465873.702910.143400@g43g2000cwa.googlegroups.com> NNTP-Posting-Host: 192.35.35.34 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1131565069 9273 127.0.0.1 (9 Nov 2005 19:37:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 9 Nov 2005 19:37:49 +0000 (UTC) In-Reply-To: <1131465873.702910.143400@g43g2000cwa.googlegroups.com> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g44g2000cwa.googlegroups.com; posting-host=192.35.35.34; posting-account=R0BKUQwAAAAEH1zhMKQoEzkWfZJu3USj Xref: g2news1.google.com comp.lang.ada:6330 Date: 2005-11-09T11:37:44-08:00 List-Id: 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