comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@notmyhomepage.invalid>
Subject: Re: Trivial question: how to avoid confusing sec, min, hour and day in a program?
Date: Sun, 24 Oct 2021 12:08:12 +0200	[thread overview]
Message-ID: <sl3bac$8r8$1@dont-email.me> (raw)
In-Reply-To: <5dcbccb3-1e2b-42cb-91e1-4be31442a647n@googlegroups.com>

On 24.10.21 08:52, reinert wrote:
> Ada seems to guarantee that Duration covers 24 hours (?). What you do when you need to represent for example 5 years?

The computing apparatus running the program  might not always be on.
"Always" is a reference to real time. So when it's turned off,
a duration object in the program would incur lost time.

So, some form of persistent storage is needed. I'd use values of types
that allow computing offsets in time. Store these every now and then,
e.g., as representing time passed.

  parent reply	other threads:[~2021-10-24 10:08 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
2021-10-24  7:24     ` J-P. Rosen
2021-10-24 10:39       ` Jeffrey R.Carter
2021-10-24 10:08     ` G.B. [this message]
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