Skip to content

Instantly share code, notes, and snippets.

@prafulliu
Created December 30, 2012 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prafulliu/4411731 to your computer and use it in GitHub Desktop.
Save prafulliu/4411731 to your computer and use it in GitHub Desktop.
lua判断两天是否连续
local t1 = os.time{year = 2012, month = 12, day = 19, hour = 0, sec = 0}
local t2 = os.time{year = 2012, month = 12, day = 19, hour = 23, sec = 59}
if (t1 - t2) <= 86400 and
(os.date("%d", t1) ~= os.date("%d",t2)) then
-- 判断是否有新手目标
print("called")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment