[Inno/Code] Get Date to String...

Inno Setup Discussion
Post Reply
User avatar
-=[4lfre1re]=-
Posts: 183
Joined: Sun Jan 10, 2016 10:38 am

[Inno/Code] Get Date to String...

Post by -=[4lfre1re]=- » Tue Feb 23, 2016 4:23 pm

[Inno/Code] Get Date to String...

With this code we can get date to use in String, for example to use in INI section...

Code: Select all

[/b]
var
  TodaysName : String;

function GetToday : String;
begin
  Result := GetDateTimeString ('yyyy/mm/dd', '/', ':');
end;

function GetTodaysName (Param: String): String;
begin
  if ('' = TodaysName) then
  begin
    TodaysName := GetToday ();
  end;
  Result := TodaysName;
end;[/quote]


[b]Date example:[/b] [quote]2016/02/23[/quote]

[b]INI example:[/b][quote][b][INI][/b]
FileName: "{app}\MyFile.ini"; Section: "Options"; Key: "Install_Date"; [color=#FF0000]String: "{code:GetTodaysName}"[/color];[/quote]

Cheers... ;-)
Last edited by niTe_RiDeR_Pr0 on Mon Apr 18, 2016 6:32 am, edited 1 time in total.
Reason: Fixed typos ;)
Image

Post Reply