How to get local date time in Inno Setup?

2019-04-06 09:38发布

Is there a way to get local date time stamp in Inno Setup ?

标签: inno-setup
1条回答
Explosion°爆炸
2楼-- · 2019-04-06 10:00

The answer depends on when you need it.

  • Needed at the time the setup is built
  • Needed at the time of install.

Needed at the time the setup is built.

You will need to use ISPP which is part of the Quick Start pack.

You can use the str GetDateTimeString(str, str, str) function.

Example: #define MyDateTimeString GetDateTimeString('dd/mm/yyyy hh:nn:ss', '-', ':');

The help menu in ISTool (Also a part of the Quick Start Pack) has a good help file for ISPP functions including this one where there is a page of information on this function.

Needed at the time of install.

Although a different source, the function is also called GetDateTimeString Then it must be in a pascal coding block.

Example:

function DateTime : String;
begin
  result := GetDateTimeString('dd/mm/yyyy hh:nn:ss', '-', ':');
end;

The details of how to use it are found in the Help File.

Although both functions have the same name, the context of when they are used is important to understanding why you would get one value over another.

查看更多
登录 后发表回答