如何在Lua脚本中获取当前UTC时间? [英] How to get current utc time in Lua script?
本文介绍了如何在Lua脚本中获取当前UTC时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用Lua脚本获取当前utc时间并将其转换为人类可读的文本.
How can I get current utc time using Lua script and convert it to human readable text.
推荐答案
尝试os.date("!%c")
.在这里,!
表示UTC,而%c
表示标准格式的完整日期.有关其他选项,请参见 http://www.lua.org/manual/5.2/manual .html#pdf-os.date .
Try os.date("!%c")
. Here !
means UTC and %c
means full date in standard format. For other options, see http://www.lua.org/manual/5.2/manual.html#pdf-os.date.
这篇关于如何在Lua脚本中获取当前UTC时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文