944,079 Members | Top Members by Rank

Ad:
Feb 4th, 2006
0

change system date

Expand Post »
hello
Can anyone send me a link of a component that allows me to change system date or time? thanks.
Similar Threads
vjp
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vjp is offline Offline
1 posts
since Jan 2006
Apr 24th, 2006
0

Re: change system date

Hey,

Heres some code to change the system time and date:

With the procedure SetDateTime you can set the date and time of the operating system, from within your Delphi application.

In the interface-section you define the procedure:

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;

Katrix36
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Katrix36 is offline Offline
16 posts
since Jan 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Character/letter count
Next Thread in Pascal and Delphi Forum Timeline: Blocking all internet traffic/activity





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC