How to add months to a date (datetime object)?

Deborah Swanson python at deborahswanson.net
Mon Feb 6 03:23:11 EST 2017


bajimicbiga at gmail.com wrote, on February 02, 2017 2:44 AM
> 
> for start of month to the beginning of next month
> 
> from datetime import timedelta
> from dateutil.relativedelta import relativedelta
> 
> end_date = start_date + relativedelta(months=delta_period) + 
> timedelta(days=-delta_period)

Where do you define 'delta_period', and what is your question?




More information about the Python-list mailing list