local start = os.time{year=2016, month=2, day=1, hour=20,min=0,sec=0}
local finish = os.time{year=2016, month=2, day=16, hour=2,min=0,sec=0}
local now = os.time()
local now_date = os.date("*t",now)
local start_date = os.date("*t",start)
if now > start and now < finish then
print("in activity")
end
print(now_date)
print("year:" .. now_date.year)
print("month:" .. now_date.month)
print("day:" .. now_date.day)
print("hour:" .. now_date.hour)
print(start_date)
print("year:" .. start_date.year)
print("month:" .. start_date.month)
print("day:" .. start_date.day)
print("hour:" .. start_date.hour)
lua os.time与os.date的简单用法
最新推荐文章于 2024-09-23 12:37:50 发布