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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2b151131f90050ab X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-29 18:21:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!ppp-1-88.cvx5.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: Ada, calendar, and daylight savings Date: Tue, 30 Oct 2001 02:19:51 -0000 Message-ID: <9rl2s2$u9eai$1@ID-25716.news.dfncis.de> References: <3BDCEEFF.10409@acm.org> <9rjq8j$at5$1@nh.pace.co.uk> <3BDD94E6.2030804@acm.org> NNTP-Posting-Host: ppp-1-88.cvx5.telinco.net (212.1.152.88) X-Trace: fu-berlin.de 1004408515 31766866 212.1.152.88 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:15388 Date: 2001-10-30T02:19:51+00:00 List-Id: My suggestion is as follows: package Ada.Calendar.Worldwide is type Zoned_Time is private; -- This type includes the offset from UTC with the actual time. type Time_Zone_Offset is delta 30*60.0 range -12*60*60.0 .. +12*60*60.0; -- An offset from UTC, in seconds, as half-hour intervals from -12 to -- +12 hours. Localtime = TimeUTC + offset. function Clock return Zoned_Time; -- Also concurrently ascertains the local offset from UTC. function Local_Time (Zoned: Zoned_Time) return Time; -- Returns the local time from a Zoned_Time. function Time_UTC (Zoned: Zoned_Time) return Time; -- Returns the time UTC from a Zoned_Time. function Difference_from_UTC (Zoned: Zoned_Time) return Time_Zone_Offset; -- Returns the offset from UTC for a Zoned_Time. function Current_Difference_from_UTC return Time_Zone_Offset; -- Returns the offset from UTC currently set. Could change at any time. function To_Zoned (Date: Time; Difference: Time_Zone_Offset := 0.0) return Zoned_Time; private ... -- implementation defined end Ada.Calendar.Worldwide; I think this should go into an optional Annex. I'd like to see the range of Day_Duration extended: subtype Day_Duration is Duration range 0.0 .. 86_405.0; in Ada.Calendar in the next revision, to allow for added leap seconds. -- Nick Roberts "Corey Minyard" wrote in message news:3BDD94E6.2030804@acm.org... > Marin David Condic wrote: > ... > I'm not saying that it needs to use UTC for implementation, but I think > it at least needs an annex to be able to coordinate time in some way. > And if it uses daylight savings and timezones, the program needs some > way to get that information and do translations into different timezones. > > > Better that a more sophisticated time package be included as some kind of > > annex or optional package. That's why I suggested that it might make a good > > candidate for a standard component library. > > I'm already working on it. I was just wondering how it should interact > with Ada.Calendar, and I think I know now.