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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee78aab9bfd2fe2a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!peernews!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Inspiration for a better calendar package? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <873agxd6i1.fsf@nbi.dk> <12gqldae49yoe$.1sf2zlz1fthvh.dlg@40tude.net> <6qmg8dFd8kd2U1@mid.individual.net> Date: Mon, 15 Dec 2008 10:00:16 +0100 Message-ID: <1jv16tgrmhor4$.c3a8ugjxu6ed$.dlg@40tude.net> NNTP-Posting-Date: 15 Dec 2008 10:00:16 CET NNTP-Posting-Host: 23f760f2.newsspool3.arcor-online.net X-Trace: DXC=6O4=_:MYm3kg2:J^iH;KEI^2 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2988 Date: 2008-12-15T10:00:16+01:00 List-Id: On Mon, 15 Dec 2008 08:45:17 +0100, Wilhelm Spickermann wrote: > Dmitry A. Kazakov wrote: > >> We just do not need political time otherwise than for >> formatted text output. It was silly for Ada 2005 to define time >> arithmetic in terms of political time. Especially because there >> �simply is no way to define such arithmetic. Since political >> time increment "+" is not a function of its arguments! > > I'd propose using two kinds of time each with an own > arithmetic -- both of them being not political. > > The first one is a somehow physical time, which just counts every > second occuring in reality. The arithmetic for this one is > obvious and it should have a fine granularity. This is Ada.Real_Time.Time. The problem with it is that it does not have any bias to UTC. > The second one is a wall clock time with the smallest unit being > a minute on the wall clock (thus having 59, 60 or 61 seconds > length). We can define an arithmetic here and it is used to > specify times related to human activities. This time is used to > store dates like "second monday after easter 2014 at 10:00 UTC" > or "every day at 12:00 UTC". Why cannot you use UTC instead? Political time is a combination of UTC time and the time zone. The latter is a function that yields the time offset for each given UTC time value. Yes you could skew the resolution down to the point where any differences become invisible. What about one year? (:-)) The question what this thing could be used for? It is a madness to make hour a function of current time and place... > They should not allow mixed arithmetic and conversions bewteen > them are only possible as far as our knowledge of leap seconds > allows. (The leap second information of traditional Unix time > zone tables is unusable here, since they have no way of > specifying "unknown leap second".) > > Additionally we should have time zone tables (without leap second > information) for political time (also needing the ability to > specify "unknown") to do conversions between "political text > representations of time" and "wall clock" time. It also contains > the completely predefined time zone "UTC". I think it can be done much simpler. Conversion to/from political time should simply take time zone offset as the parameter. This is how presently Ada.Calendar.Formatting does. The package Ada.Calendar.Time_Zones already has all tables behind the function UTC_Time_Offset. The only problem is the argument of the function. It must be UTC time instead of political one. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de