Calendar Clock! 
Author Message
 Calendar Clock!

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!



Sun, 03 Dec 2000 03:00:00 GMT  
 Calendar Clock!

Quote:

> 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.



Sun, 03 Dec 2000 03:00:00 GMT  
 Calendar Clock!

Quote:

> 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 -


--------------------------------------------------------------

  vcard.vcf
< 1K Download


Sun, 03 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Calendar.Clock vs. Real_Time.Clock

2. A question about CALENDAR.CLOCK

3. System Clock update rate of 0.055 milliseconds in DOS/Win95 and Ada.Calendar

4. calendar and clock programs

5. clock scan [clock format [clock seconds]] fails

6. change TOD clock with set and store clock

7. How to do IP clock balance with external clock

8. How to Generate 1MHz clock from 44MHz Clock??

9. Problem with clocking logic usign a derived clock

10. Gated Clock(double rate clock)?

11. clocking on rising AND falling edge of a clock

12. rising_edge(clock) vs clock'event

 

 
Powered by phpBB® Forum Software