Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ada > #49418

Re: Trivial question: how to avoid confusing sec, min, hour and day in a program?

From "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Newsgroups comp.lang.ada
Subject Re: Trivial question: how to avoid confusing sec, min, hour and day in a program?
Date 2021-09-05 09:27 +0200
Organization Aioe.org NNTP Server
Message-ID <sh1rha$14d6$1@gioia.aioe.org> (permalink)
References <c1e4f8bf-f3f0-4a14-b057-37f330461f9cn@googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.ada | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Trivial question: how to avoid confusing sec, min, hour and day in a program? reinert <reinkor@gmail.com> - 2021-09-04 23:56 -0700
  Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-05 09:27 +0200
    Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? Niklas Holsti <niklas.holsti@tidorum.invalid> - 2021-09-05 15:42 +0300
    Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? ldries46 <bertus.dries@planet.nl> - 2021-09-06 09:20 +0200
      Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-06 11:47 +0200
        Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? ldries46 <bertus.dries@planet.nl> - 2021-09-06 15:06 +0200
          Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? "J-P. Rosen" <rosen@adalog.fr> - 2021-09-06 15:43 +0200
            Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? ldries46 <bertus.dries@planet.nl> - 2021-09-06 16:13 +0200
              Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2021-09-06 11:10 -0400
        Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? AdaMagica <christ-usch.grein@t-online.de> - 2021-09-06 08:55 -0700
      Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? Shark8 <onewingedshark@gmail.com> - 2021-09-08 15:00 -0700
    Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? reinert <reinkor@gmail.com> - 2021-10-23 23:52 -0700
      Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? "J-P. Rosen" <rosen@adalog.fr> - 2021-10-24 09:24 +0200
        Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> - 2021-10-24 12:39 +0200
      Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? "G.B." <bauhaus@notmyhomepage.invalid> - 2021-10-24 12:08 +0200
      Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? Simon Wright <simon@pushface.org> - 2021-10-24 11:48 +0100
      Re: Trivial question: how to avoid confusing sec, min, hour and day in a program? Björn Lundin <b.f.lundin@gmail.com> - 2021-10-24 14:09 +0200

csiph-web