python get month code example
Example 1: python date get day
import datetime
dt = datetime.datetime.today()
year = dt.year
month = dt.month
day = dt.day
Example 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.