from datetime import datetime,date
dayOfWeek = datetime.now()#.weekday()
print dayOfWeek
dayOfWeek = datetime.today()#.weekday()
dayOfWeek = datetime.now()#.weekday()
print dayOfWeek
dayOfWeek = datetime.today()#.weekday()
print dayOfWeek
if year:
year = int(year)
else: year = datetime.today().year
if month: month = int(month)
else: month = datetime.date.month # 获取当月第一天的星期和当月的总天数
firstDayWeekDay, monthRange = calendar.monthrange(year, month)
# 获取当月的第一天 firstDay = datetime.date(year=year, month=month, day=1)
lastDay = datetime.date(year=year, month=month, day=monthRange) # date(year=year,month=month,day=daymonthRange)
return firstDay, lastDay