> Hi all can someone remind me how to Progmatically changing
> Computers Date ??
>
> I have some ASM code, but it nearly killed my machine when I
> ran it.....The
> code is :-
>  Procedure SetDate(Year,Month,Day : Word); Assembler;
>   Asm
>     mov ah,2Bh
>     mov cx,Year
>     mov dh,BYTE PTR Month
>     mov dl,BYTE PTR Day
>     int 21h
>   End;

Interesting - I just cut this from a D1 app I am working on at the
moment:
 
{gb nov 98 - borrowed from Borlands 'windos.pas' that contains classic
TurboPascal routines
 probably won't work under NT.
 parameter ranges are: Year 1980-2099, Month 1-12 and Day 1-31. }
procedure SetDate(Year, Month, Day: Word); assembler;
asm
   MOV     CX,Year
   MOV     DH,BYTE PTR Month
   MOV     DL,BYTE PTR Day
   MOV     AH,2BH
   INT     21H
end;

I threw the code in when I discovered that the Win API did not have a
set date function. 
Win32 does however so best to use SetSystemTime which also sets the Date
- obviously ;-)
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to