Answers for "datetime.timedelta(days=1)"

4

python today - 1 day

from datetime import datetime, timedelta

yesterday = datetime.today() - timedelta(days = 1 )
Posted by: Guest on April-15-2020
3

datetime.timedelta months

from datetime import timedelta
from dateutil.relativedelta import relativedelta

end_date = start_date + relativedelta(months=delta_period) + timedelta(days=-delta_period)
Posted by: Guest on June-30-2020
0

datetime decreasing date python

from datetime import datetime, timedelta

d = datetime.today() - timedelta(days=days_to_subtract)
Posted by: Guest on May-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language