From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.5 required=3.0 tests=BAYES_05,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.6 X-Received: by 2002:a0c:e8c5:: with SMTP id m5mr4788206qvo.33.1635058338121; Sat, 23 Oct 2021 23:52:18 -0700 (PDT) X-Received: by 2002:a5b:cce:: with SMTP id e14mr9338272ybr.486.1635058337936; Sat, 23 Oct 2021 23:52:17 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 23 Oct 2021 23:52:17 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=84.209.88.37; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 84.209.88.37 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5dcbccb3-1e2b-42cb-91e1-4be31442a647n@googlegroups.com> Subject: Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? From: reinert Injection-Date: Sun, 24 Oct 2021 06:52:18 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:63069 List-Id: Ada seems to guarantee that Duration covers 24 hours (?). What you do when = you need to represent for example 5 years? reinert s=C3=B8ndag 5. september 2021 kl. 09:27:41 UTC+2 skrev Dmitry A. Kazakov: > On 2021-09-05 08:56, reinert wrote:=20 > > Anybody with good ideas on how (in a simplest possible way) to avoid to= confuse between representation of time as seconds, minutes, hours and days= in an Ada program? > Just use the standard type Duration. > > It is somewhere in my program natural/human to think in seconds whereas= minutes or hours feels more natural at other places (so the numerics is "h= uman"). Example to illustrate: heart rate is "natural" to give in number pe= r minute (not in number per second, hour or day). Time on work is normally = given by hours (not seconds) etc.. > The user interface is responsible to convert anything to Duration and bac= k.=20 >=20 > --=20 > Regards,=20 > Dmitry A. Kazakov=20 > http://www.dmitry-kazakov.de