Skip to content

Commit

Permalink
time_util 注释纠正
Browse files Browse the repository at this point in the history
  • Loading branch information
huahua132 committed Jan 6, 2025
1 parent 90a704c commit 9c9bc12
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lualib/skynet-fly/utils/time_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ function M.string_to_date(str, split1, split2)
return date
end

--适配当月最后一天
function M.month_last_day(date, day)
--适配当月某一天
function M.month_day(date, day)
local year = date.year
local month = date.month
date.day = day
Expand Down Expand Up @@ -225,13 +225,13 @@ function M.every_month(day,hour,min,sec)
cur_date.min = min
cur_date.sec = sec

M.month_last_day(cur_date, day)
M.month_day(cur_date, day)
local next_time = os.time(cur_date)
if next_time > cur_time then
return next_time
else
cur_date.month = cur_date.month + 1
M.month_last_day(cur_date, day)
M.month_day(cur_date, day)
return os.time(cur_date)
end
end
Expand All @@ -252,14 +252,14 @@ function M.every_year(month,day,hour,min,sec)
cur_date.min = min
cur_date.sec = sec

M.month_last_day(cur_date, day)
M.month_day(cur_date, day)
local next_time = os.time(cur_date)

if next_time > cur_time then
return next_time
else
cur_date.year = cur_date.year + 1
M.month_last_day(cur_date, day)
M.month_day(cur_date, day)
return os.time(cur_date)
end
end
Expand Down

0 comments on commit 9c9bc12

Please sign in to comment.