def _get_last_month():
current = date.today()
if current.day == 31:
return date(current.year, current.month-1, (calendar.monthrange(current.year, current.month-1)[1])).strftime('%Y-%m')
else:
return date(current.year, current.month-1, current.day).strftime('%Y-%m')
评论列表
文章目录