tags: lua
-------------------------------------------------------------------------
- Get the number of days specified date
--------------------------------------------------------------------------
function getDayByYearMonth(_year, _month)
local _curYear = tonumber(_year)
local _curMonth = tonumber(_month)
if not _curYear or _curYear <= 0 or not _curMonth or _curMonth <= 0 then
return
end
local _curDate = {}
_curDate.year = _curYear
_curDate.month = _curMonth + 1
_curDate.day = 0
local _maxDay = os.date("%d",os.time(_curDate))
return _maxDay
end
result: Java determines how many days there are in a month Result:...
0 preface We sometimes write batch processingShell When the script is required, you may need to get the date before the specified date (later) N days / month, where N can be 1 day / month / year, 2 da...
Python specifies the number of days in the month, the specified date is a few days, the specified month has several Sundays, leap year Calender 1, the number of days of the specified month 2, the spec...