A program containing changing time routine does change time when it runs in Borland Delphi 7 IDE. But it does not change time when it runs independently (outside the Delphi IDE). I am using windows 7. Can you please help? Thank you.
...
procedure TForm1.changetime;
begin
DateSeparator:='-';
ShortDateFormat:='yyyy-MM-dd';
LongDateFormat:='yyyy''Year'',MM''Month'',dd''Date''';
TimeSeparator:=':';
DateTimetoString(date,'yyyy-mm-dd',now);
DateTimetoString(time,'hh:nn:ss',now);
cd:='2014-06-01 '+time;
d1:=StrToDateTime(cd);
DateTimeToSystemTime(d1,systemtime);
SetLocalTime(SystemTime);
end;
...
systemtime.wYear:= 2014;right away. - AmigoJack