1 (* Library module defined by the International Standard
2 Information technology - programming languages
3 BS ISO/IEC 10514-1:1996E Part 1: Modula-2, Base Language.
5 Copyright ISO/IEC (International Organization for Standardization
6 and International Electrotechnical Commission) 1996-2021.
8 It may be freely copied for the purpose of implementation (see page
9 707 of the Information technology - Programming languages Part 1:
10 Modula-2, Base Language. BS ISO/IEC 10514-1:1996). *)
12 DEFINITION MODULE SysClock
;
14 (* Facilities for accessing a system clock that records the date
18 maxSecondParts
= 1000000 ;
26 Fraction
= [0 .. maxSecondParts
];
27 UTCDiff
= [-780 ..
720];
36 fractions
: Fraction
; (* parts of a second *)
37 zone
: UTCDiff
; (* Time zone differential
38 factor which is the number
39 of minutes to add to local
40 time to obtain UTC. *)
41 summerTimeFlag
: BOOLEAN; (* Interpretation of flag
42 depends on local usage. *)
45 PROCEDURE CanGetClock(): BOOLEAN;
46 (* Tests if the clock can be read *)
48 PROCEDURE CanSetClock(): BOOLEAN;
49 (* Tests if the clock can be set *)
51 PROCEDURE IsValidDateTime(userData
: DateTime
): BOOLEAN;
52 (* Tests if the value of userData is a valid *)
54 PROCEDURE GetClock(VAR userData
: DateTime
);
55 (* Assigns local date and time of the day to userData *)
57 PROCEDURE SetClock(userData
: DateTime
);
58 (* Sets the system time clock to the given local date and