如何在 Inno Setup 中获取本地日期时间?

发布于 2024-09-07 07:46:18 字数 36 浏览 2 评论 0原文

有没有办法在 Inno Setup 中获取本地日期时间戳?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

隔纱相望 2024-09-14 07:46:18

答案取决于您何时需要它。

  • 构建设置时
  • 需要安装时需要。

构建设置时需要。

您将需要使用 ISPP,它是快速入门包的一部分。

您可以使用 str GetDateTimeString(str, str, str) 函数。

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

ISTool(也是快速入门包的一部分)有一个很好的 ISPP 功能帮助文件,其中包括一页有关此功能的信息。

安装时需要。

虽然来源不同,但该函数也称为 GetDateTimeString
那么它一定是在一个pascal编码块中。

示例:

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

有关如何使用它的详细信息,请参阅帮助文件

尽管这两个函数具有相同的名称,但使用它们时的上下文对于理解为什么您会获得一个值而不是另一个值非常重要。

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.

穿越时光隧道 2024-09-14 07:46:18

我更新了你的代码:

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

I updated your code:

function ActualDate(Param: string): String;
begin
   result := GetDateTimeString('dd/mm/yyyy hh:nn:ss', '-', ':');
end; 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文