home *** CD-ROM | disk | FTP | other *** search
- (* Functions to return strings of Current System Time and Date *)
-
- type
- String16 = String[16];
- String24 = String[24];
-
- function SDate: string24;
- const
- wday: array[0..6] of string[8] =
- ('Sunday','Monday','Tuesday','Wedesday','Thursday','Friday','Saturday');
- mon: array[1..12] of string[4] =
- ('Jan.','Feb.','Mar.','Apr.','May.','Jun.','Jul.','Aug.','Sep.',
- 'Oct.','Nov.','Dec.');
- var
- regs: record
- case integer of
- 1: (AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags: Integer);
- 2: (AL, AH, BL, BH, CL, CH, DL, DH: Byte)
- end;
- Dy,Yr : string16;
-
- begin
- regs.AX := $2A00; {DOS function to get system date}
- MsDos(regs);
- Str(regs.CX:4, Yr);
- if (regs.DL <10)
- then str(regs.DL:1,dy)
- else str(regs.DL:2,dy);
-
- SDate := wday[regs.AL] + ' ' + Mon[regs.DH] + ' ' + Dy + ', ' + Yr;
-
- end; {SDate}
-
-
- function STime: string16;
-
- var
- regs: record
- case Integer of
- 1: (AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags: Integer);
- 2: (AL, AH, BL, BH, CL, CH, DL, DH: Byte)
- end;
-
- Hr,Min,Sec: String16;
-
- Begin
-
- regs.AX := $2C00; {DOS function to get system time }
- MsDos(regs);
- Str(regs.CH:2, Hr);
- Str(regs.CL:2, Min);
- str(regs.DH:2,Sec);
- If Min[1] = ' '
- then Min[1] := '0';
- if Hr[1] = ' '
- then Hr[1] := '0';
- if Sec[1] = ' '
- then Sec[1] := '0';
-
- STime := Hr + ':' + Min + '.' + Sec;
-
- end; {STime}
-