Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SetSystemTime

Posted on 2004-10-03
7
Medium Priority
?
836 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

730 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