Answers for "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
1

python timestamp shift one day

from datetime import datetime, timedelta
print datetime.now() + timedelta(days=5, hours=-5)
Posted by: Guest on May-11-2020
1

python datetime weekday

from datetime import datetime
date_str='10-12-20'
datetime_object = datetime.strptime(date_str, '%m-%d-%y')
datetime_object.weekday()
Posted by: Guest on October-13-2020
8

datetime year python

import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
Posted by: Guest on May-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language