ngx.say('ngx.time()' .. ngx.time())
ngx.say('ngx.now()' .. ngx.now())
ngx.say('ngx.today()' .. ngx.today())
ngx.say('ngx.localtime()' .. ngx.localtime())
ngx.say('ngx.utctime()' .. ngx.utctime())
ngx.say('ngx.cookie_time(1500456075)' .. ngx.cookie_time(1500456075))
ngx.say('ngx.http_time(1500456075)' .. ngx.http_time(1500456075))
ngx.say('os.time()' .. os.time())
ngx.say('------')
ngx.say(ngx.update_time())
结果:
ngx.time()1500456310
ngx.now()1500456310.884
ngx.today()2017-07-19
ngx.localtime()2017-07-19 17:25:10
ngx.utctime()2017-07-19 09:25:10
ngx.cookie_time(1500456075)Wed, 19-Jul-17 09:21:15 GMT
ngx.http_time(1500456075)Wed, 19 Jul 2017 09:21:15 GMT
os.time()1500456310
------