python datetime now
import datetime
print(datetime.datetime.now()) #datetime.datetime.now() is the syntax
python datetime now
import datetime
print(datetime.datetime.now()) #datetime.datetime.now() is the syntax
python datetime now
import datetime
print(datetime.datetime.now()) #datetime.datetime.now() is the syntax
timedelta python
current_date = datetime.date.today()
delta = datetime.timedelta(80)
print(current_date - delta)
timedelta python
current_date = datetime.date.today()
delta = datetime.timedelta(80)
print(current_date - delta)
timedelta
>>> import datetime
>>> d1 = datetime.date.today()
>>> from dateutil.relativedelta import relativedelta
>>> d1 + relativedelta(months=1)
datetime.date(2012, 4, 8)
>>> d2 = datetime.date(year=2012,month=1,day=31)
>>> d2 + relativedelta(months=1)
datetime.date(2012, 2, 29)
timedelta
>>> import datetime
>>> d1 = datetime.date.today()
>>> from dateutil.relativedelta import relativedelta
>>> d1 + relativedelta(months=1)
datetime.date(2012, 4, 8)
>>> d2 = datetime.date(year=2012,month=1,day=31)
>>> d2 + relativedelta(months=1)
datetime.date(2012, 2, 29)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us