comp.lang.ada
 help / color / mirror / Atom feed
* Timestamps in Ada
@ 2002-03-12 12:07 A.I
  2002-03-12 12:34 ` Marc A. Criley
  2002-03-12 14:40 ` Georg Bauhaus
  0 siblings, 2 replies; 8+ messages in thread
From: A.I @ 2002-03-12 12:07 UTC (permalink / raw)


Hi, I want a server program to write logfiles with timestamping, something
like:

...
[11/03/2002 13:04:15] Connection from 127.0.0.0
...

how can I get the Date and Time in Ada? and conversion to string?

Another question. I like the Ada Reference Manual in the Windows .hlp
version very much, it's easy to find what you're looking for, but i'm now
working under a unix environment. What is the best and quickest source for
Ada documentation?

Thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Timestamps in Ada
  2002-03-12 12:07 Timestamps in Ada A.I
@ 2002-03-12 12:34 ` Marc A. Criley
  2002-03-12 12:48   ` Peter Hermann
  2002-03-14 15:42   ` Alfred Hilscher
  2002-03-12 14:40 ` Georg Bauhaus
  1 sibling, 2 replies; 8+ messages in thread
From: Marc A. Criley @ 2002-03-12 12:34 UTC (permalink / raw)


"A.I" wrote:
> 
> Hi, I want a server program to write logfiles with timestamping, something
> like:
> 
> ...
> [11/03/2002 13:04:15] Connection from 127.0.0.0
> ...
> 
> how can I get the Date and Time in Ada? and conversion to string?

Use the Clock function in the standard Calendar package to get the time
(which comprises both date and time), and if you're using GNAT, you can
use the GNAT.Calendar.Time_IO function to convert it into the desired
string representation.

There are some other "time conversion" utilities available that others
here will likely mention.

Marc A. Criley
Consultant
Quadrus Corporation
www.quadruscorp.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Timestamps in Ada
  2002-03-12 12:34 ` Marc A. Criley
@ 2002-03-12 12:48   ` Peter Hermann
  2002-03-12 13:21     ` Nazgul
  2002-03-14 15:42   ` Alfred Hilscher
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Hermann @ 2002-03-12 12:48 UTC (permalink / raw)


Marc A. Criley <mcqada95@earthlink.net> wrote:
> Use the Clock function in the standard Calendar package to get the time

> There are some other "time conversion" utilities available that others
> here will likely mention.

thank you, Marc, yes, of course  :-)

http://www.csv.ica.uni-stuttgart.de/homes/ph/adapilotresources/basic_tools/calenday.ads

-- 
--Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de
--Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
--http://www.csv.ica.uni-stuttgart.de/homes/ph/
--Team Ada: "C'mon people let the world begin" (Paul McCartney)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Timestamps in Ada
  2002-03-12 12:48   ` Peter Hermann
@ 2002-03-12 13:21     ` Nazgul
  2002-03-12 16:44       ` Jeffrey Carter
  0 siblings, 1 reply; 8+ messages in thread
From: Nazgul @ 2002-03-12 13:21 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

Thanks all, I just used Ada.Calendar and Gnat.Calendar for the Hour & Minute
& Second functions, and all works right.

"Peter Hermann" <ica2ph@iris16.csv.ica.uni-stuttgart.de> escribi� en el
mensaje news:a6kteh$bab$1@news.uni-stuttgart.de...
> Marc A. Criley <mcqada95@earthlink.net> wrote:
> > Use the Clock function in the standard Calendar package to get the time
>
> > There are some other "time conversion" utilities available that others
> > here will likely mention.
>
> thank you, Marc, yes, of course  :-)
>
>
http://www.csv.ica.uni-stuttgart.de/homes/ph/adapilotresources/basic_tools/c
alenday.ads
>
> --
> --Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de
> --Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
> --http://www.csv.ica.uni-stuttgart.de/homes/ph/
> --Team Ada: "C'mon people let the world begin" (Paul McCartney)





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Timestamps in Ada
  2002-03-12 12:07 Timestamps in Ada A.I
  2002-03-12 12:34 ` Marc A. Criley
@ 2002-03-12 14:40 ` Georg Bauhaus
  2002-03-12 18:15   ` Ada docs, was " tmoran
  1 sibling, 1 reply; 8+ messages in thread
From: Georg Bauhaus @ 2002-03-12 14:40 UTC (permalink / raw)


A.I <airadier@able.es> wrote:

:  What is the best and quickest source for
: Ada documentation?

You could use either of the text, info, or html versions,
present in GNAT docs packages, 
for example somewhere in ftp://cs.nyu.edu/pub/gnat/

- georg



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Timestamps in Ada
  2002-03-12 13:21     ` Nazgul
@ 2002-03-12 16:44       ` Jeffrey Carter
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey Carter @ 2002-03-12 16:44 UTC (permalink / raw)


Nazgul wrote:
> 
> Thanks all, I just used Ada.Calendar and Gnat.Calendar for the Hour & Minute
> & Second functions, and all works right.

As long as you're using GNAT. For a portable solution, see
PragmARC.Date_Handler.

-- 
Jeffrey Carter



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Ada docs, was Re: Timestamps in Ada
  2002-03-12 14:40 ` Georg Bauhaus
@ 2002-03-12 18:15   ` tmoran
  0 siblings, 0 replies; 8+ messages in thread
From: tmoran @ 2002-03-12 18:15 UTC (permalink / raw)


>:  What is the best and quickest source for
>: Ada documentation?
>You could use either of the text, info, or html versions,
>present in GNAT docs packages,
>for example somewhere in ftp://cs.nyu.edu/pub/gnat/
Or
http://www.adaic.org/standards/ada95.html
http://www.ada-auth.org/~acats/arm.html
http://www.adapower.com/rm95/index.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Timestamps in Ada
  2002-03-12 12:34 ` Marc A. Criley
  2002-03-12 12:48   ` Peter Hermann
@ 2002-03-14 15:42   ` Alfred Hilscher
  1 sibling, 0 replies; 8+ messages in thread
From: Alfred Hilscher @ 2002-03-14 15:42 UTC (permalink / raw)




"Marc A. Criley" wrote:
> > how can I get the Date and Time in Ada? and conversion to string?
> 
> Use the Clock function in the standard Calendar package to get the time

A while ago I wrote a program (GNAT 3.13p, WinNT, 3 tasks) which used
the "Calendar" package to write timestamps into a logfile, but I
realised that when the system time changes (due to sync with a time
server, or even by calling "Time" in a DOS window), the Ada.Calendar
time doesn't change. So the logfile didn't reflect the events correctly.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-03-14 15:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-12 12:07 Timestamps in Ada A.I
2002-03-12 12:34 ` Marc A. Criley
2002-03-12 12:48   ` Peter Hermann
2002-03-12 13:21     ` Nazgul
2002-03-12 16:44       ` Jeffrey Carter
2002-03-14 15:42   ` Alfred Hilscher
2002-03-12 14:40 ` Georg Bauhaus
2002-03-12 18:15   ` Ada docs, was " tmoran

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