home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
at
/
datefix.arc
/
DATEFIX.4TP
< prev
next >
Wrap
Text File
|
1987-12-01
|
1KB
|
50 lines
{$R-} {Range checking off}
{$B+} {Boolean complete evaluation on}
{$S+} {Stack checking on}
{$I+} {I/O checking on}
{$N-} {No numeric coprocessor}
{$M 65500,16384,655360} {Turbo 3 default stack and heap}
program datefix;
Uses
Dos;
var
regs: registers;
year,month,day,hour,minute,second : word;
function dec(bcd:byte):byte;
var h,l : byte;
begin
h := trunc(bcd/16);
l := bcd-h*16;
dec := 10*h+l;
end;
begin
with regs do
begin
{read time from AT clock}
AH := $02;
intr($1A,Dos.Registers(regs));
hour := dec(CH);
minute := dec(CL);
second := dec(DH);
{read date from AT clock}
AH := $04;
intr($1A,Dos.Registers(regs));
day := dec(DL);
month := dec(DH);
year := dec(CL)+100*dec(CH);
SetTime(hour,minute,second,$0000);{set DOS time}
SetDate(year,month,day);{set DOS date}
{ writeln (hour,':',minute,':',second);
writeln(month,'/',day,'/',year);
} end;
end.