comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Getting current date and time
Date: Wed, 25 Jul 2007 00:26:50 -0700
Date: 2007-07-25T00:26:50-07:00	[thread overview]
Message-ID: <1185348410.753153.22950@d55g2000hsg.googlegroups.com> (raw)
In-Reply-To: <1185290698.850041.204530@z28g2000prd.googlegroups.com>

On 24 Lip, 17:24, Adam Beneschan <a...@irvine.com> wrote:

> > The problem is that I need just a number of seconds (this is for
> > interfacing with other software which uses that Unix-like time
> > descriptions), so I cannot use the value which is broken down into
> > several components.
>
> Why not?  Differences returns the result in "days" and "seconds", and
> you should be able to convert the "days" to seconds by multiplying it
> by a value that I just recently helped my 9-year-old figure out, and
> then adding the result to the second value, and then maybe adding the
> leap seconds (see below).

Right. I didn't notice that it's just two components, not more
(without years, months and days).

> We could
> conceivably propose a new addition to Ada.Calendar.Arithmetic:
>
> function
> Return_Current_Time_However_The_Other_Software_Maciej_Is_Using_Does_It;
>
> but I sort of doubt that a proposal like that would be accepted.

On my system Ada.Calendar.Time_Of and Ada.Calendar.Formatting.Time_Of
behave *differenty* with the same arguments, so with such a mess
already in the library no additional proposal could hurt...

Thank you for pointing me in the right direction, I was able now to
get the expected values by using Ada.Calendar.Formatting.Time_Of.

--
Maciej Sobczak
http://www.msobczak.com/




  reply	other threads:[~2007-07-25  7:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-22 21:21 Getting current date and time Maciej Sobczak
2007-07-22 23:00 ` Martin
2007-07-23 15:24   ` koburtch
2007-07-23 19:57   ` Maciej Sobczak
2007-07-23 20:02     ` Maciej Sobczak
2007-07-23 20:08       ` Maciej Sobczak
2007-07-23 21:43         ` Adam Beneschan
2007-07-24  8:53           ` Maciej Sobczak
2007-07-24  9:41             ` Georg Bauhaus
2007-07-24  9:58               ` Maciej Sobczak
2007-07-24 15:24             ` Adam Beneschan
2007-07-25  7:26               ` Maciej Sobczak [this message]
2007-07-25  7:42                 ` AW: " Grein, Christoph (Fa. ESG)
2007-07-28  8:20             ` Wilhelm Spickermann
2007-08-01  9:45         ` Jacob Sparre Andersen
2007-07-23 21:39       ` Adam Beneschan
2007-07-23 19:26 ` Gautier
replies disabled

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