Answers for "python get currentmonth"

2

python get current month

Use:

from datetime import datetime
today = datetime.today()
datem = datetime(today.year, today.month, 1)
I assume you want the first of the month.
Posted by: Guest on March-08-2021
0

python get currentmonth

from datetime import datetime

print(datetime.now().month)
Posted by: Guest on April-07-2022

Python Answers by Framework

Browse Popular Code Answers by Language