Answers for "how to get the year from a date in python"

11

get the current year in python

import datetime
now = datetime.datetime.now().year
print(now)
Posted by: Guest on May-12-2020
1

how to get the year and month in python

import calander
ear = int(input("Input the year:- "))
Month = int(input("Input the month:- "))
print(calendar.month(y, m))
Posted by: Guest on July-27-2021

Code answers related to "how to get the year from a date in python"

Python Answers by Framework

Browse Popular Code Answers by Language