DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦e79d2ba9a⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Date, seg_05822d

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



-- UNIT: procedure DATE
-- FILES: date.a
-- COMPILE AND LINK: ada -o date -M date date.a
-- PURPOSE: show use of CALENDAR package in STANDARD library.
-- DESCRIPTION: displays current system date and time.
--              Usage: date
-- .......................................................................... --

with Calendar;
use Calendar;
with Text_Io;
use Text_Io;

procedure Date is

    package Int_Io is new Integer_Io (Integer);
    use Int_Io;

    Sec_In_Hour : constant Integer := 3600;
    Sec_In_Minute : constant Integer := 60;

    subtype Hour_Number is Integer range 0 .. 23;
    subtype Minute_Number is Integer range 0 .. 59;
    subtype Second_Number is Integer range 0 .. 59;

    T : Time;
    Y : Year_Number;
    M : Month_Number;
    D : Day_Number;
    Xx : Duration;
    X : Integer;
    H : Hour_Number;
    N : Minute_Number;
    S : Second_Number;

begin

    T := Clock;
    Split (T, Y, M, D, Xx);
    X := Integer (Xx);
    H := X / Sec_In_Hour;
    N := (X / Sec_In_Minute) mod 60;
    S := X mod Sec_In_Minute;
    Put (M, 1);
    Put ("/");
    Put (D, 1);
    Put ("/");
    Put (Integer'Image (Y) (4 .. 5));
    Put (" ");
    Put (H, 1);
    Put (":");
    Put (Integer'Image (N + 100) (3 .. 4));
    Put (":");
    Put (Integer'Image (S + 100) (3 .. 4));
    New_Line;

end Date;
pragma Main;
-- .......................................................................... --
--
-- DISTRIBUTION AND COPYRIGHT:
--
-- This software is released to the Public Domain (note:
--   software released to the Public Domain is not subject
--   to copyright protection).
-- Restrictions on use or distribution:  NONE
--
-- DISCLAIMER:
--
-- This software and its documentation are provided "AS IS" and
-- without any expressed or implied warranties whatsoever.
-- No warranties as to performance, merchantability, or fitness
-- for a particular purpose exist.
--
-- Because of the diversity of conditions and hardware under
-- which this software may be used, no warranty of fitness for
-- a particular purpose is offered.  The user is advised to
-- test the software thoroughly before relying on it.  The user
-- must assume the entire risk and liability of using this
-- software.
--
-- In no event shall any person or organization of people be
-- held responsible for any direct, indirect, consequential
-- or inconsequential damages or lost profits.

E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=29 rec1=00 rec2=01 rec3=006
        [0x01] rec0=21 rec1=00 rec2=03 rec3=040
        [0x02] rec0=0d rec1=00 rec2=02 rec3=000
    tail 0x217657e0687e16c9e7ee5 0x42a00088462060003