-1

Can someone show me a few lines of code on how to add one day to datetime?

Like if you had some initial date:

start_date = datetime.date(1847, 3, 30)

and simply wanted to change it to (1847, 3, 31)

and then (1847, 4, 1)

and so on.

I'm new to Python and just trying to wrap my head around this import.

Aiden P.
  • 29
  • 3
  • 3
    There are so many answers for this question. Please put some effort into researching your question. – MooingRawr Dec 05 '17 at 22:05
  • 1
    Welcome to SO. Unfortunately this isn't a discussion forum or tutorial. Please take the time to read [ask] and the links it contains. Invest some time with [the Tutorial](https://docs.python.org/3/tutorial/index.html) practicing the examples. It will give you an idea of the tools Python offers to help you solve your problem. – wwii Dec 05 '17 at 22:12

1 Answers1

2
startdate + datetime.timedelta(days=1) 

will give you the answer

usernamenotfound
  • 1,540
  • 2
  • 11
  • 18