Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SetSystemTime

Posted on 2004-10-03
7
Medium Priority
?
851 Views
Last Modified: 2008-02-20
what is the delphi function for SetSystemTime()  and SetSystemDate() ?
If delphi doesn't have functions for the above how do I do it.

Thanks
0
Comment
Question by:amielDorel
7 Comments
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12213133
System time and date is all in one function:

The tSystemTime fields are:

    wYear
    wMonth
    wDayOfWeek
    wDay
    wHour
    wMinute
    wSecond
    wMilliseconds

var
  ST:tSystemTime;

procedure DoIt;
begin
  GetSystemTime(ST);
  ST.wDay:=ST.wDay+1;
  SetSystemTime(ST);
end;
0
 
LVL 4

Accepted Solution

by:
LMuadDIb earned 500 total points
ID: 12213136
procedure TForm1.Button1Click(Sender: TObject);
var
  dt: TSystemTime;
begin
  dt.wYear:=1999;
  dt.wMonth:=2;
  dt.wDay:=25;
  dt.wHour:=9;
  dt.wMinute:=0;
  dt.wSecond:=0;
  dt.wMilliseconds:=0;
  if SetSystemTime(dt) then Label1.Caption:='Setting finished';
end;


hope this helps,
^ENuD
0
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12213142
BTW, Get/SetSystemTime is in the Windows unit.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Expert Comment

by:LRHGuy
ID: 12214054
Doesn't seem fair. I gave all the correct information first, yet my answer get ignored.
0
 
LVL 2

Expert Comment

by:-Karamja-
ID: 12228417
LRHGuy that is so unfair, lol. You should of got the points
LMuadDIb had to spoon feed the code
0
 
LVL 4

Expert Comment

by:LMuadDIb
ID: 12231766
spoon feed? or post an answer that is more clear?
0
 

Author Comment

by:amielDorel
ID: 12233803
I am sorry, I would have liked to accept multiple answers, you were all very helpfull

Thanks
 
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question