Solved

SetSystemTime

Posted on 2004-10-03
7
816 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 125 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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