Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get current month python

import calendar
from datetime import date

current_month_name = calendar.month_name[date.today().month]
# the variable will hold something like 'April'

#if you want the abbreviated version:
current_month_name_abbreviated = calendar.month_abbr[date.today().month]
# the variable will hold something like 'Apr' now instead of 'April'
Source by deepmatter.ai #
 
PREVIOUS NEXT
Tagged: #current #month #python
ADD COMMENT
Topic
Name
4+7 =