Lua获取当前时间
2017-08-15 11:38
537 查看
local getTime = os.date(“%c”);
其中的%c可以是以下的一种:(注意大小写)
如获取当前年月日时分秒:local date=os.date(“%Y-%m-%d %H:%M:%S”);
os.time()
获取当前秒
其中的%c可以是以下的一种:(注意大小写)
%a | abbreviated weekday name (e.g., Wed) |
%A | full weekday name (e.g., Wednesday) |
%b | abbreviated month name (e.g., Sep) |
%B | full month name (e.g., September) |
%c | date and time (e.g., 09/16/98 23:48:10) |
%d | day of the month (16) [01-31] |
%H | hour, using a 24-hour clock (23) [00-23] |
%I | hour, using a 12-hour clock (11) [01-12] |
%M | minute (48) [00-59] |
%m | month (09) [01-12] |
%p | either “am” or “pm” (pm) |
%S | second (10) [00-61] |
%w | weekday (3) [0-6 = Sunday-Saturday] |
%x | date (e.g., 09/16/98) |
%X | time (e.g., 23:48:10) |
%Y | full year (1998) |
%y | two-digit year (98) [00-99] |
%% | the character ‘%’ |
os.time()
获取当前秒
相关文章推荐
- Lua 获取当前时间
- Lua获取当前时间
- C++ LUA 获取当前时间并转化为字符串
- Lua获取当前时间
- lua中获取系统当前的时间
- lua获取当前时间
- Lua获取当前时间
- Lua获取当前时间
- lua获取网络当前时间戳
- Lua获取当前时间
- JS获取当前时间戳的方法
- iOS --获取当前时间和当前时间戳
- Smarty 获取当前日期时间和格式化日期时间
- cmd 获取当前时间
- oracle获取小于或等于当前时间行列
- Android--获取当前系统时间
- JAVA中获取当前系统时间
- 每天进步一点点之SQL 获取表中某个时间字段离当前时间最近的几条
- JS获取当前时间戳的方法
- mysql获取当前时间,日期之前和日期之后的日期