AdaPower Logged in as Guest
Ada Tools and Resources

Ada 95 Reference Manual
Ada Source Code Treasury
Bindings and Packages
Ada FAQ


Join >
Articles >
Ada FAQ >
Getting Started >
Home >
Books & Tutorials >
Source Treasury >
Packages for Reuse >
Latest Additions >
Ada Projects >
Press Releases >
Ada Audio / Video >
Home Pages >
Links >
Contact >
About >
Login >
Back
GNAT.Calendard Example (David Botton)

with Ada.Calendar;

with GNAT.Calendar; use GNAT.Calendar;
with GNAT.Calendar.Time_IO;
with GNAT.IO; use GNAT.IO;


procedure GNAT_CAL is
   Now : Ada.Calendar.Time := Ada.Calendar.Clock;
begin
   Put_Line ("Hour :" & Hour (Now)'Img);
   Put_Line ("Minute :" & Minute (Now)'Img);
   Put_Line ("Second :" & Second (Now)'Img);
   Put_Line ("Sub_Second :" & Sub_Second (Now)'Img);
   Put_Line ("Day_Of_Week :" & Day_Of_Week (Now)'Img);
   Put_Line ("Day_In_Year :" & Day_In_Year (Now)'Img);
   Put_Line ("Week_In_Year :" & Week_In_Year (Now)'Img);

   GNAT.Calendar.Time_IO.Put_Time (Now,
                                   GNAT.Calendar.Time_IO.US_Date);

   New_Line;

   GNAT.Calendar.Time_IO.Put_Time (Now,
                                   "Today is %A, %B %d, %Y");

   New_Line;

end GNAT_CAL;


(c) 1998-2004 All Rights Reserved David Botton