DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦347da02c6⟧ TextFile

    Length: 2289 (0x8f1)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Io;
with Calendar;
with Time_Utilities;
procedure Day_Of_The_Week (Date : in String := ">> MONTH/DAY/YEAR <<") is
    --
    type Weekday is (Sunday, Monday, Tuesday, Wednesday,
                     Thursday, Friday, Saturday);

    function Day_Of_Week (Date : in Calendar.Time) return Weekday is
        --
        Century : Integer;
        Year_In_Century : Integer;
        First_Date : Integer;
        Days_Per_Month : array (1 .. 12) of Calendar.Day_Number :=
           (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
        Year : Calendar.Year_Number;
        Month : Calendar.Month_Number;
        Day : Calendar.Day_Number;
        Seconds : Calendar.Day_Duration;
        --
    begin
        Calendar.Split (Date => Date,
                        Year => Year,
                        Month => Month,
                        Day => Day,
                        Seconds => Seconds);
        if ((((Year / 100) mod 4) = 0) or ((Year mod 100) /= 0)) and then
           (((Year mod 100) mod 4) = 0) then
            Days_Per_Month (2) := 29;
        end if;
        Century := (Year - 1) / 100;
        Year_In_Century := (Year - 1) mod 100;
        First_Date := (99 - Century * 2 + Century / 4 +
                       Year_In_Century + Year_In_Century / 4) mod 7;
        for I in 1 .. Month - 1 loop
            First_Date := (First_Date + Days_Per_Month (I)) mod 7;
        end loop;
        First_Date := ((First_Date + Day - 1) mod 7);
        return Weekday'Val (First_Date);
    end Day_Of_Week;
    --
begin
    Io.Put (Time_Utilities.Image (Date => Time_Utilities.Value (S => Date),
                                  Contents => Time_Utilities.Date_Only));
    Io.Put (" IS A ");
    case Day_Of_Week (Time_Utilities.Convert_Time
                         (Time_Utilities.Value (Date))) is
        when Sunday =>
            Io.Put_Line ("SUNDAY.");
        when Monday =>
            Io.Put_Line ("MONDAY.");
        when Tuesday =>
            Io.Put_Line ("TUESDAY.");
        when Wednesday =>
            Io.Put_Line ("WEDNESDAY.");
        when Thursday =>
            Io.Put_Line ("THURSDAY.");
        when Friday =>
            Io.Put_Line ("FRIDAY.");
        when Saturday =>
            Io.Put_Line ("SATURDAY.");
    end case;
end Day_Of_The_Week;