Closed xq114 closed 3 months ago
Bot detected the issue body's language is not English, translate it automatically.
In what scenario do you need this feature?
I hope to encode the Unix timestamp during construction into the program. To do this, I need to obtain the current system time. However, xmake only provides the file modification time os.mtime, and there is no API to directly obtain the time. Currently, the encoding time can only be written according to the platform. Script acquisition is very troublesome (windows Get-Date -UFormat %s
, unix date +%s
)
Add os.timestamp or os.systime api to obtain system time
No response
No response
Bot detected the issue body's language is not English, translate it automatically.
Isn’t there os.date and os.time?
文档里没搜到,看来是文档问题
Bot detected the issue body's language is not English, translate it automatically.
I couldn't find it in the documentation. It seems to be a documentation problem.
这两是 lua 原生接口,文档暂时没写,可以来 pr 补下
Bot detected the issue body's language is not English, translate it automatically.
These two are Lua's native interfaces. The documentation has not been written yet. You can come to PR to make up for it.
你在什么场景下需要该功能?
希望将构建时的Unix时间戳编码到程序中,为此需要获取当前系统时间,但xmake中只提供了文件修改时间os.mtime,没有直接获取时间的api;目前要编码时间只能分平台写script获取,非常麻烦(windows
Get-Date -UFormat %s
,unixdate +%s
)描述可能的解决方案
增加os.timestamp或者os.systime api获取系统时间
描述你认为的候选方案
No response
其他信息
No response