如何在 Inno Setup 中获取当前的 Unix 时间戳?
请让我知道如何在 Inno Setup 中获取当前的 Unix 时间戳?
Please let me know How to get current Unix timestamp in Inno Setup?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是使用
time()
来自 C 运行时库的函数,其返回值如下:这正是 unix 时间戳 。
现在只需将该函数导入 Inno Setup 脚本即可。由于脚本环境不知道指针,因此参数(幸运的是不需要指向有效的缓冲区,请参阅链接的文档)以整数形式给出,并且您必须为其传递 0:
The easiest way is to use the
time()
function from the C runtime library, which has the following return value:which is exactly what the unix timestamp is.
Now it's a simple matter of importing that function into Inno Setup scripting. Since the scripting environment doesn't know pointers the parameter (which luckily need not point to a valid buffer, see the linked documentation) is given as integer and you must pass a 0 for it: