How to get local date time in Inno Setup?

后端 未结 1 2080
一生所求
一生所求 2021-02-14 09:50

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

相关标签:
1条回答
  • 2021-02-14 10:43

    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.

    0 讨论(0)
提交回复
热议问题