lua的时间和日期函数  

-- ::|  分类: Lua |  标签:lua  时间  函数   |举报|字号 订阅

下载LOFTER客户端
--获取当前的时间戳,单位是秒。
time=os.time();
print(time); --获得当前的时间table,有year,month,day,hour,min,sec等元素。
tab=os.date("*t",time); --或直接tab=os.date("*t"); --tab是table的简写。
print(tab.year, tab.month, tab.day, tab.hour, tab.min, tab.sec); --获得当前的时间字符串,形如"08/27/12"。
str=os.date("%x",time); --或直接使用str=os.date("*x");
print(str); 参考:
os库-时间函数:http://blog.csdn.net/kanelu/article/details/4678903

lua的时间和日期函数的更多相关文章

  1. Python 关于时间和日期函数使用 -- (转)

    python中关于时间和日期函数有time和datatime   1.获取当前时间的两种方法: import datetime,time now = time.strftime("%Y-%m ...

  2. 标准c时间与日期函数

    标准c时间与日期函数 asctime 语法:     #include <time.h>   char *asctime( const struct tm *ptr ); 功能: 函数将p ...

  3. PHP之时间和日期函数

    // 时间日期函数 Time <?php date_default_timezone_set('UTC'); // 获取当前时间的时间戳 $time0 = mktime(); $time1 = ...

  4. mysql 中时间和日期函数应用

    一.MySQL 获得当前日期时间 函数 1.1 获得当前日期+时间(date + time)函数:now() mysql> select now(); +-------------------- ...

  5. python 时间及日期函数

    本人最近新学python ,用到关于时间和日期的函数,经过一番研究,从网上查找资料,经过测试,总结了一下相关的方法. import timeimport datetime '''时间转化为时间戳: 2 ...

  6. [转]详细的mysql时间和日期函数

    这里是一个使用日期函数的例子.下面的查询选择了所有记录,其date_col的值是在最后30天以内: mysql> SELECT something FROM table WHERE TO_DAY ...

  7. mysql 中 时间和日期函数

    From: http://www.cnblogs.com/redfox241/archive/2009/07/23/1529092.html 一.MySQL 获得当前日期时间 函数 1.1 获得当前日 ...

  8. php第五节(字符串函数和时间、日期函数)

    <?php //查找字符串函数 // strpos() 查找字符第一次出现的位置 重点区分大小写 //stripos — 查找字符串首次出现的位置(不区分大小写) //strrpos — 计算指 ...

  9. postgreSQL时间、日期函数

    一.获取系统时间函数 1.1.获取当前完整时间 select now(); select current_timestamp; 1.2.获取当前日期 select currnt_date: 1.3.获 ...

随机推荐

  1. 发一个比trace功能更强大debug工具,MonterDebugger

    经常看到兄弟说trace不出东西啊,这样给你调试会带来很多不便:加入说我们需要将运行时的debug信息和之前某个版本的进行比对:又加入说我们需要在运行时通过debug动态调整显示对象的属性:查看当前整 ...

  2. Eclipse中执行maven命令

    1.如下图,右击需要执行maven命令的工程,选择"Debug As"或"Run As",再选择"Maven build..." 进行如上操 ...

  3. zxing生成二维码和读取二维码

    当然,首先要导入zxing的jar包. 生成二维码代码: package com.imooc.zxing; import java.io.File; import java.nio.file.Path ...

  4. WAF实现扫描器识别

    目前安全测试的软件越来越多,也越来越强大,越来越多的人成为[黑客],今天在网上看到一个文章说拦截wvs的扫描,勾起了我写这篇文章的欲望.   因为公司的三大业务之一就有一个云waf,每天拦截的日志里面 ...

  5. Cannot generate SSPI context

    请在参考如下文章前,重启服务器解决! 相信我 没错的! http://support.microsoft.com/kb/811889

  6. C++ 重写重载重定义区别

    C++ 重写重载重定义区别 (源自:http://blog.163.com/clevertanglei900@126/blog/static/111352259201102441934870/) 1 ...

  7. [Javascript] Automate the process of flattening deeply nested arrays using ES2019's flat method

    Among the features introduced to the language of JavaScript in ES2019 is Array.prototype.flat. In th ...

  8. [Functional Programming Moand] Update The State Of A State Monad (put)

    Stateful computations require the ability for their state to change overtime. We take a look on one ...

  9. 拓扑排序的实现_TopoSort

    拓扑排序是求一个AOV网(顶点代表活动, 各条边表示活动之间的率先关系的有向图)中各活动的一个拓扑序列的运算, 可用于測试AOV 网络的可行性. 整个算法包含三步: 1.计算每一个顶点的入度, 存入I ...

  10. [莫队算法 线段树 斐波那契 暴力] Codeforces 633H Fibonacci-ish II

    题目大意:给出一个长度为n的数列a. 对于一个询问lj和rj.将a[lj]到a[rj]从小到大排序后并去重.设得到的新数列为b,长度为k,求F1*b1+F2*b2+F3*b3+...+Fk*bk.当中 ...