python 讀取當月天數
- 2020 年 1 月 9 日
- 筆記
在python中獲取某月的天數有二種方式: 1:使用calendar庫 import calendar calendar.mothrange(2010,2)[1] 28 2:使用datetime庫 import datetime (datetime.datetime(2010.3) – datetime.datetime(2010.2)).days 28
在python中獲取某月的天數有二種方式: 1:使用calendar庫 import calendar calendar.mothrange(2010,2)[1] 28 2:使用datetime庫 import datetime (datetime.datetime(2010.3) – datetime.datetime(2010.2)).days 28