Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 459 Bytes

114.md

File metadata and controls

24 lines (19 loc) · 459 Bytes
@author jackzhenguo
@desc 
@date 2019/10/14

114 月最后一天

from datetime import date
import calendar
mydate = date.today()
_, days = calendar.monthrange(mydate.year, mydate.month)
month_last_day = date(mydate.year, mydate.month, days)
print(f"当月最后一天:{month_last_day}\n")

打印结果:

当月最后一天:2019-12-31
[上一个例子](113.md) [下一个例子](115.md)