comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Re: Trivial question: how to avoid confusing sec, min, hour and day in a program?
Date: Sat, 23 Oct 2021 23:52:17 -0700 (PDT)	[thread overview]
Message-ID: <5dcbccb3-1e2b-42cb-91e1-4be31442a647n@googlegroups.com> (raw)
In-Reply-To: <sh1rha$14d6$1@gioia.aioe.org>

Ada seems to guarantee that Duration covers 24 hours (?). What you do when you need to represent for example 5 years?

reinert

søndag 5. september 2021 kl. 09:27:41 UTC+2 skrev Dmitry A. Kazakov:
> On 2021-09-05 08:56, reinert wrote: 
> > 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 "human"). Example to illustrate: heart rate is "natural" to give in number per 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 back. 
> 
> -- 
> Regards, 
> Dmitry A. Kazakov 
> http://www.dmitry-kazakov.de

  parent reply	other threads:[~2021-10-24  6:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-05  6:56 Trivial question: how to avoid confusing sec, min, hour and day in a program? reinert
2021-09-05  7:27 ` Dmitry A. Kazakov
2021-09-05 12:42   ` Niklas Holsti
2021-09-06  7:20   ` ldries46
2021-09-06  9:47     ` Dmitry A. Kazakov
2021-09-06 13:06       ` ldries46
2021-09-06 13:43         ` J-P. Rosen
2021-09-06 14:13           ` ldries46
2021-09-06 15:10             ` Dennis Lee Bieber
2021-09-06 15:55       ` AdaMagica
2021-09-08 22:00     ` Shark8
2021-10-24  6:52   ` reinert [this message]
2021-10-24  7:24     ` J-P. Rosen
2021-10-24 10:39       ` Jeffrey R.Carter
2021-10-24 10:08     ` G.B.
2021-10-24 10:48     ` Simon Wright
2021-10-24 12:09     ` Björn Lundin
replies disabled

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