I\'m trying to find the first day of the month in python with one condition: if my current date passed the 25th of the month, then the first date variable will hold the first da
Use dateutil.
from datetime import date from dateutil.relativedelta import relativedelta today = date.today() first_day = today.replace(day=1) if today.day > 25: print(first_day + relativedelta(months=1)) else: print(first_day)