9951 explained code solutions for 126 technologies

python-pandasGet current year and month

from datetime import datetime

currentYearMonth = "{month}/{year}".format(
  month = datetime.now().month,
  year = datetime.now().year
)ctrl + c
from datetime import datetime

import datetime utility to operate with time


returns current date object


attribute returns year


attribute returns month


format resulting month/year string in a given way


will contain final formatted month/year string