两个时间戳相减 获得的秒 装换为 年 月 天 时 分
2018-09-03 本文已影响0人
陈玉涛
--下面两个时间自己设置
local left_time = GetLeftTime() --离开时间
local cur_server_time = GetCurTime() --当前时间
timestamp_year = math.floor((cur_server_time - left_time)/ (3600 * 24 * 30 * 12)) --年
timestamp_month = math.floor((cur_server_time - left_time)/ (3600 * 24 * 30)) --月
timestamp_day = math.floor((cur_server_time - left_time)/ (3600 * 24)) --日
timestamp_hour = math.floor((cur_server_time - left_time)/ 3600) --小时
timestamp_minutes = math.floor((cur_server_time - left_time)/ 60) --分钟