Answers for "datetime day 1 to 7"

4

python today - 1 day

from datetime import datetime, timedelta

yesterday = datetime.today() - timedelta(days = 1 )
Posted by: Guest on April-15-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