Answers for "add 30 day date python"

7

python date add days

date_1 = datetime.datetime.strptime(start_date, "%m/%d/%y")

end_date = date_1 + datetime.timedelta(days=10)
Posted by: Guest on May-12-2021
0

python set day of date to 1

from datetime import datetime

your_date = datetime.strptime('26 June 2021', '%d %b %Y')
# Using the .replace() method:
newdatetime = your_date.replace(day=1)
# 2021-06-01 00:00:00
Posted by: Guest on July-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language