Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Time Units

Spec.TimeUnits History

Hide minor edits - Show changes to output

2010-05-24 13:23 by benjk -
Added lines 1-31:
[@DEFINITION MODULE TimeUnits;

(* Base Units for Date and Time *)


IMPORT INTEGER16, Unsigned31, Unsigned24, Unsigned60, UnsignedReal60;


TYPE
    Year = INTEGER16;
    (* base unit for calendar years, -32768 .. 32767 *)
   
    Month = ( Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec );
    (* base unit for calendar months *)
   
    Day = Unsigned31;
    (* base unit for calendar days, 1 .. 31 *)
   
    Days = CARDINAL32;
    (* base unit for elapsed days, 0 .. 4294967295 *)
   
    Hours = Unsigned24;
    (* base unit for hour of the day, 0 .. 23 *)
   
    Minutes = Unsigned60;
    (* base unit for minutes in an hour, 0 .. 59 *)
   
    Seconds = UnsignedReal60;
    (* base unit for fractional seconds in a minute, 0 .. 59.999 *)

END TimeUnits.@]