comp.lang.ada
 help / color / mirror / Atom feed
* Re: Calendar Clock!
       [not found] <01bd9987$0ad1d3c0$cfcb60cf@vlcvqqui>
  1998-06-17  0:00 ` Calendar Clock! Matthew Heaney
@ 1998-06-17  0:00 ` John J Cupak Jr, CCP
  1 sibling, 0 replies; 2+ messages in thread
From: John J Cupak Jr, CCP @ 1998-06-17  0:00 UTC (permalink / raw)
  To: Yanick Hudon

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

Yanick Hudon wrote:
> 
> Hi! EveryOne,
> 
> I would like to know if there is a way to get the date of the system with
> the package Ada.Calendar like we can do in C???
> 
> Can someone give me some information about that???
> 
> Thanks in advance!

Well, Yanick, I presume your comment "like we can do in C" means calling 
the strftime function defined in <time.h>?

Ada.Calendar does NOT define any formatting for time values. If you want
to format time values, you will have to write your own "time-to-string"
function, or else scrounge up a copy of Wizard Ware's Calendar Utility
package (see "Software Components with Ada", G. Booch). Or, you could
search
the public domain libraries for Ada calendar formatting packages.

Good luck!
-- 
--------------------------------------------------------------
-                 John J. Cupak Jr, CCP                      -
- Raytheon Systems Company - Software Engineering Laboratory -
- tel: 978-858-1222   email (work): jcj@swl.msd.ray.com      -
- fax: 978-858-4336   email (home): jcupak@aol.com           -
--------------------------------------------------------------

[-- Attachment #2: Card for Cupak Jr, CCP, John J. --]
[-- Type: text/x-vcard, Size: 481 bytes --]

begin:          vcard
fn:             John J. Cupak Jr, CCP
n:              Cupak Jr, CCP;John J.
org:            TWK
adr;dom:        50 Apple Hill Road;;MS T3MN35;Tewksbury;MA;01879;
email;internet: jcj@swl.msd.ray.com
title:          Senior Software Engineer / Instructor
tel;work:       225-1222
tel;fax:        978-858-4336
tel;home:       603-595-8240
note:           EMAIL;AOL:jcupak@aol.com
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


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

* Re: Calendar Clock!
       [not found] <01bd9987$0ad1d3c0$cfcb60cf@vlcvqqui>
@ 1998-06-17  0:00 ` Matthew Heaney
  1998-06-17  0:00 ` John J Cupak Jr, CCP
  1 sibling, 0 replies; 2+ messages in thread
From: Matthew Heaney @ 1998-06-17  0:00 UTC (permalink / raw)



"Yanick Hudon" <yannick@nospawn.videotron.ca> writes:

> I would like to know if there is a way to get the date of the system with
> the package Ada.Calendar like we can do in C???

Package Calendar _does_ return the date.

declare
   Year  : Year_Number;
   Month : Month_Number;
   Day   : Day_Number;
   Seconds : Day_Duration;
begin
   Split 
     (Date => Clock,
      Year => Year,
      Month => Month,
      Day   => Day,
      Seconds => Seconds);
end;


I'm not clear if you meant just "get the date," or if you meant, "get a
time string whose format is like that in C."

If you meant the former, then Calendar.Clock does the trick.

If you meant the latter, then there are utilities you can use to create
a string representation of time, in various formats.  Check the PAL.
Check DejaNews too - I think this question was asked recently, and
someone named an actual unit in the PAL.





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

end of thread, other threads:[~1998-06-17  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <01bd9987$0ad1d3c0$cfcb60cf@vlcvqqui>
1998-06-17  0:00 ` Calendar Clock! Matthew Heaney
1998-06-17  0:00 ` John J Cupak Jr, CCP

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