procedure SetDateTime(Year, Month, Day, Hour, Minu, Sec, MSec: Word);In the 
'implementation' you write...:

{ SetDateTime sets the date and time of the operating system }
procedure SetDateTime(Year, Month, Day, Hour, Minu, Sec, MSec: Word);
var
  NewDateTime: TSystemTime;
begin
  FillChar(NewDateTime, SizeOf(NewDateTime), #0);
  NewDateTime.wYear := Year;
  NewDateTime.wMonth := Month;
  NewDateTime.wDay := Day;
  NewDateTime.wHour := Hour;
  NewDateTime.wMinute := Minu;
  NewDateTime.wSecond := Sec;
  NewDateTime.wMilliseconds := MSec;
  SetLocalTime(NewDateTime);
end;Regards !Dimitris Botsis----- Original Message ----- 
From: "Dan Statham" <[EMAIL PROTECTED]>
To: <advanced_delphi@yahoogroups.com>
Sent: Wednesday, March 22, 2006 8:49 PM
Subject: [advanced_delphi] Set the PC's clock


> Good Morning!
>
>   I have a requirement to take a string representation of a date and
> a time and use them to set the PC's clock.
>
>   I know I can create a TDateTime object from the two strings. What I
> do not know how to do is to set the clock with this new time value.
>
>   I know about net time /set, but that takes a domain and computer
> name and sets the time to it's time. That is not what the requirement
> is.
>
>   Does anyone know how to set the clock?
>
> Thanks...Dan'l
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.2.6/286 - Release Date: 20/3/2006
>
> 

__________________________________________________
×ñçóéìïðïéåßôå Yahoo!;
ÂáñåèÞêáôå ôá åíï÷ëçôéêÜ ìçíýìáôá (spam);   Ôï Yahoo! Mail äéáèÝôåé ôçí 
êáëýôåñç äõíáôÞ ðñïóôáóßá êáôÜ ôùí åíï÷ëçôéêþí ìçíõìÜôùí  
http://mail.yahoo.gr 


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/advanced_delphi/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to