Get first and last date of previous month in Django

165 views Asked by At

I need to get the first and last date of the previous month from today.

    curr_ = timezone.now().replace(hour=0, minute=0, second=0, microsecond=0)
    curr_date = curr_.date()
    prev_date = curr_date - relativedelta(months=1) 

The above lines will give a complete month from today, but I need the previous complete month (start and end date).

0

There are 0 answers