Lua获取当前时间
更多好的文章就在 blog.haoitsoft.com,请大家多多支持!
local getTime = os.date(“%c”);
其中的%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 ‘%’ |
如获取当前年月日时分秒:local date=os.date(“%Y-%m-%d %H:%M:%S”);
Lua获取当前时间的更多相关文章
- Lua获取网络时间
作者:ani_di 版权所有,转载务必保留此链接 http://blog.csdn.net/ani_di Lua获取网络时间 网络授时服务是一些网络上的时间服务器提供的时间,一般用于本地时钟同步. ...
- Lua获取系统时间和时间格式化方法及格式化参数
一.系统当前时间对应的时间戳 复制代码代码如下: local ntime = os.timeprint(ntime) 二.格式化时间显示,参考下表常用于设置header等 复制代码代码如下: ngx. ...
- [转] lua 获取本地当月天数
亲测,无误. 原文传送门:lua 获取本地当月天数 开发中有用到,记录一下. local year,month = os.date("%Y", os.time()), os.dat ...
- iOS中获取当前时间,设定时间,并算出差值
NSDate *date = [NSDate date];//获取当前时间 NSTimeZone *zone = [NSTimeZone systemTimeZone];//修改时区 NSIntege ...
- Js获取当前日期时间及其它操作
Js获取当前日期时间及其它操作var myDate = new Date();myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); //获取完整的年份 ...
- 【转】Js获取当前日期时间及格式化操作
(转自:http://www.cnblogs.com/qinpengming/archive/2012/12/03/2800002.html) var myDate = new Date(); myD ...
- PHP 获取中国时间,即上海时区时间
/** * 获取中国时间,即上海时区时间 * @param <type> $format * @return <type> */ function getChinaTime($ ...
- C#获取北京时间与设置系统时间
获取北京时间 public static DateTime GetBeijingTime() { DateTime dt; // 返回国际标准时间 // 只使用 timeServers 的 IP 地址 ...
- Lua库之时间和日期操作
Lua库之时间和日期操作 (2010-02-07 18:41:20) 转载▼ os.time() <== 返回当前系统的日历时间os.date() <== 返回本地化的时间字符串,这里是& ...
随机推荐
- 关于linux下mysql 5.7.x数据库的yum的安装方法
环境介绍>>>>>>>>>>>>>>>>>> 操作系统:Centos 7.1 mysql数据 ...
- iOS - 开发中加载本地word/pdf文档说明
最近项目中要加载一个本地的word/pdf等文件比如<用户隐私政策><用户注册说明>,有两种方法加载 > 用QLPreviewController控制器实现 步骤 : & ...
- Installation Guide Ubuntu 16.04
Beside the installation guide on the main page, here is a guide to install GenieACS off a freshly in ...
- day_6.22python多线程
僵尸进程:子进程结束,父类未结束 孤儿进程:父类进程over.,子进程未结束 0号进程负责运行,1号进程负责生成,所有孤儿进程的收容所(孤儿进程:父类进程over)1号进程,永不结束! Linux: ...
- 夺冠概率|2012年蓝桥杯B组题解析第九题-fishers
(17')夺冠概率 足球比赛具有一定程度的偶然性,弱队也有战胜强队的可能. 假设有甲.乙.丙.丁四个球队.根据他们过去比赛的成绩,得出每个队与另一个队对阵时取胜的概率表: 甲 乙 丙 丁 甲 - 0. ...
- textarea 固定大小,滚动条,限制拖动,文字对齐
取值:$("#ID").val(); 控制大小:加width,height限制(style="width:100px;height:200px;");或row, ...
- Could not write file: C:\......\.classpath
最近因为换操作系统,把项目从Mac系统copy到了win10下,出现了不少项目部署启动上的问题.最开始的一个问题是:Could not write file: C:\......\.classpath ...
- hdu3374 String Problem【最小表示法】【exKMP】
String Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- rsync定时同步文件
rsync服务器 ip:192.168.1.198 操作系统:centos7.2 rsync客户端 ip:192.168.1.16 操作系统:centos7.2 服务器配置 1.yum -y inst ...
- 抽屉之Tornado实战(1)--分析与架构
抽屉之Tornado实战(1)--分析与架构 项目模拟地址:http://dig.chouti.com/ 知识点应用: AJAX 用于偷偷发请求 原生ajax jQuery ajax($.aj ...