title: Add days in datetime and convert to string format in python
body: <p>I have a code requirement where the "expired date" should be +3 days of the current date in a string format. Following is my code,</p>
  
  <pre><code>import datetime
  now = datetime.datetime.utcnow()  #Today's date is '2/11/2017'
  expires_at = '%d/%d/%d' % (now.day + 3, now.month, now.year)
  </code></pre>
  
  <p>This works perfectly and output is similar to "5/11/2017" which is expected. However, this code breaks when the current date is 28th or 29th. Python somehow added the date to 33rd instead of skipping to 1st of the month. I have done my research and found a solution which works in Python Console (following) but failing to run under Selenium Web Driver and Pycharm.</p>
  
  <pre><code>&gt;&gt;&gt; from datetime import datetime, timedelta
  &gt;&gt;&gt; m = '29/10/2017'
  &gt;&gt;&gt; date = datetime.strptime(m, "%d/%m/%Y")
  &gt;&gt;&gt; modified_date = date + timedelta(days=3)
  &gt;&gt;&gt; datetime.strftime(modified_date, "%d/%m/%Y")
  '01/11/2017'
  </code></pre>
  
  <p>When run the same code under pycharm, the following error occurs:</p>
  
  <pre><code>Error
  Traceback (most recent call last):
     date = datetime.strptime(m, "%d/%m/%Y")
  Exception: module 'datetime' has no attribute 'strptime'
  </code></pre>
  
  <p>Any help is appreciated. I am using python 3.6.1 if anyone's curious. Probably missing something very small (2 possible solutions but none of them works) but stuck on this code for 3 days and unable to find the correct solution. </p>