传递给 os.date() 的第一个参数是格式字符串。我见过人们使用 *t
和 !*t
作为格式字符串。
两者有区别吗?
最佳答案
lua ref manual描述这个:
If format starts with '!', then the date is formatted in Coordinated Universal Time
这两个例子说明了区别:
local t = os.date( "!%a %b %d, %H:%M")
print(t) -- Thu Oct 25, 04:01 (current UTC)
local t = os.date( "%a %b %d, %H:%M")
print(t) -- Thu Oct 25, 12:01
关于Lua os.date() - *t 和 !*t 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52980611/