Solved

SetSystemTime

Posted on 2004-10-03
7
805 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
Comment Utility
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
Comment Utility
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
Comment Utility
BTW, Get/SetSystemTime is in the Windows unit.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Expert Comment

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

Expert Comment

by:-Karamja-
Comment Utility
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
Comment Utility
spoon feed? or post an answer that is more clear?
0
 

Author Comment

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

Thanks
 
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now