The following is from WIN32.HLP which should come with Delphi.  You could
write a Delphi wrapper for this function - I couldn't find an existing one
off hand.

The SetSystemTime function sets the current system time and date. The system
time is expressed in Coordinated Universal Time (UTC). 

BOOL SetSystemTime(

    CONST SYSTEMTIME *lpSystemTime      // address of system time to set 
   );   
 

Parameters

lpSystemTime

Points to a SYSTEMTIME structure that contains the current system date and
time. 
The wDayOfWeek member of the SYSTEMTIME structure is ignored. 

 

Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error
information, call GetLastError. 

Remarks

Windows NT: The SetSystemTime function fails if the calling process does not
have the SE_SYSTEMTIME_NAME privilege. This privilege is disabled by
default. Use the AdjustTokenPrivileges function to enable this privilege and
again to disable it after the time has been set. For more information about
security privileges, see Privileges. 
Windows 95: Security privileges are not supported or required.


-----Original Message-----
From: Coulter, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 04, 1999 2:20 PM
To: Multiple recipients of list delphi
Subject: [DUG]: Progmatically changing Computers Date


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;


Can anyone help ?

Jeremy Coulter 
Application Developer

Application Development Centre
Compaq Computer New Zealand Ltd.

Phone:          64 3 371 5724 (DD)
Fax:                    64 3 371 5744
Cell:                    021 2150435
E-mail:              [EMAIL PROTECTED]
Private E-Mail:  [EMAIL PROTECTED]
 <<Jeremy Coulter.vcf>> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to