Answers for "python get the days in a month"

C#
0

python get how many days in current month

import calendar
import datetime
now = datetime.datetime.now()
print calendar.monthrange(now.year, now.month)[1]
29
Posted by: Guest on June-17-2020
9

python get day month year

import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
Posted by: Guest on May-12-2020

C# Answers by Framework

Browse Popular Code Answers by Language