#简单小程序
from datetime import datetime
import calendar
def getMonths():
d = datetime.now()
c = calendar.Calendar()
year = d.year
month = d.month
if month == 1 :
month = 12
year -= 1
else :
month -= 1
months = calendar.monthrange(year, month)[1]
return months
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。