Date access for VAX 
Author Message
 Date access for VAX

Anyone know how to access the DATE on the VAX???


Fri, 12 Aug 1994 08:33:02 GMT  
 Date access for VAX

Quote:
>Anyone know how to access the DATE on the VAX???

    Calendar.Split(Date    => Calendar.Clock,
                   Year    => Year,
                   Month   => Month,
                   Day     => Day,
                   Seconds => Seconds);

--Thor




Fri, 12 Aug 1994 21:24:07 GMT  
 Date access for VAX

Quote:
>Anyone know how to access the DATE on the VAX???

This is standard Ada. Use Calendar operations to get the date. Here is
a sample:

WITH Calendar, Text_IO;
PROCEDURE TodayDate IS

  PACKAGE My_Int_IO IS NEW Text_IO.Integer_IO(Num => Integer);

-- Finds and displays today's date in the form mm/dd/yy
-- The date is gotten from PACKAGE Calendar

  Right_Now  : Calendar.Time;           -- holds internal clock value
  This_Year  : Calendar.Year_Number;    -- holds current year
  This_Month : Calendar.Month_Number;   -- holds current month
  This_Day   : Calendar.Day_Number;     -- holds current day

  Last_Two_Digits : Natural;
  This_century    : CONSTANT Integer := 1900;

BEGIN -- TodayDate

  -- Get the current time value from the computer's clock
  Right_Now := Calendar.Clock;

  -- Extract the current month, day, and year from the time value
  This_Month := Calendar.Month(Date => Right_Now);
  This_Day   := Calendar.Day  (Date => Right_Now);
  This_Year  := Calendar.Year (Date => Right_Now);

  -- Format and display the date
  Last_Two_Digits := This_Year - This_Century;

  Text_IO.Put (Item => "Today's date is ");
  My_Int_IO.Put (Item => This_Month, Width => 1);
  Text_IO.Put (Item => '/');
  My_Int_IO.Put (Item => This_Day, Width => 1);
  Text_IO.Put (Item => '/');
  My_Int_IO.Put (Item => Last_Two_Digits, Width => 1);
  Text_IO.New_Line;

END TodayDate;

Good luck.

Mike

-------------------------------------------------------------------------------
Michael B. Feldman                       co-chair, SIGAda Education Committee

Visiting Professor 1991-92               Professor
Dept. of Comp. Sci. and Engrg.           Dept. of Elect. Engrg. and Comp. Sci.
University of Washington FR-35           The George Washington University
Seattle, WA 98105                        Washington, DC 20052


(206) 632-3794 (voice)                   (202) 994-5253 (voice)
(206) 543-2969 (fax)                     (202) 994-5296 (fax)
-------------------------------------------------------------------------------



Sat, 13 Aug 1994 16:23:57 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DATE access for ada on VAX

2. Clarion Date (Long) -> Access Date\Time

3. VAX Assembly HELP!! Time/Date stamp

4. DATE ROUTINE USING VAX FORTRAN

5. Reading VAX direct access files on a SUN

6. F77 problem reading DIRECT ACCESS files from VAX to UNIX

7. vax c to vax ada?

8. Ada digits / VAX Float Types (from INFO-VAX)

9. non-VAX VAX FORTRAN compiler

10. Access dates

11. MS Access and Dates

12. ABSOLUTE DATES: Coverting from Clarion DOS to Access 97

 

 
Powered by phpBB® Forum Software