home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
mod201j.zip
/
modula2.exe
/
os2src
/
timedate.def
< prev
next >
Wrap
Text File
|
1995-06-16
|
2KB
|
85 lines
DEFINITION MODULE TimeDate;
(*
Title : A group of time and date utilities
Limitations : Limited to dates 31 December 1899 to 4 June 2079
Author : I.R. Matters (Ian.Matters@anu.edu.au)
System : Juergen Neuhoff's Modula-2 compiler on OS/2 v3.0
Version : 1.00
Last Edit : 16 June 1995
*)
TYPE DateFormats = (Euro, US);
PROCEDURE DateNow(): CARDINAL;
(*
Returns the current date as a CARDINAL
containing the date serial number - 1 January 1900 = 1.
*)
PROCEDURE DateToStr (N: CARDINAL; F: DateFormats; VAR S: ARRAY OF CHAR);
(*
Convert a date serial number to a "DD/MM/YYYY" or
"MM-DD-YYYY" date string - day 1 = 1 January 1900
*)
PROCEDURE SerialNumberToDate (N: CARDINAL; VAR Y, M, D: CARDINAL);
(*
Convert a date serial number to a date - 1 January 1900 = 1
*)
PROCEDURE DateToSerialNumber (Y, M, D: CARDINAL): CARDINAL;
(*
Convert a date to a date serial number - 1 January 1900 = 1
*)
PROCEDURE TimeNow(): LONGCARD;
(*
Returns the current time of day as a LONGCARD
containing the number of seconds since midnight.
*)
PROCEDURE TimeToStr (N: LONGCARD; VAR S: ARRAY OF CHAR);
(*
Convert a time serial number to a "HH:MM:SS" time string
*)
PROCEDURE SerialNumberToTime (N: LONGCARD; VAR H, M, S: CARDINAL);
(*
Convert a "HH:MM:SS" time serial number to hours, minutes and seconds
*)
PROCEDURE TimeToSerialNumber (H, M, S: CARDINAL): LONGCARD;
(*
Convert a time to a time serial number - seconds since midnight
*)
PROCEDURE TimeStrToTime (TS: ARRAY OF CHAR; VAR H, M, S: CARDINAL);
(*
Convert a time string to hours, minutes and seconds
*)
PROCEDURE LeapYear (Y: CARDINAL): BOOLEAN;
(*
Is the year a leap year?
*)
PROCEDURE DaysInMonth (Y, M: CARDINAL): CARDINAL;
(*
How many days are in a given month?
*)
END TimeDate.