title: TypeError: strptime() argument 1 must be str, not datetime.date Python
body: <p>Facing issues while converting date to string,</p>
  
  <pre><code>print(type(from_date))
  from_date = datetime.datetime.strptime(from_date, '%Y-%m-%d').date()
  </code></pre>
  
  <p>My from_date value is in an ini file, </p>
  
  <pre><code>from_date = 2018-01-01
  </code></pre>
  
  <p>My TraceBack log is,</p>
  
  <pre><code>Traceback (most recent call last):
  File "Flexi_DailyToWeekly.py", line 87, in &lt;module&gt;
  tuesday = get_data(session,from_keyspace, from_table, to_keyspace, to_table_tuesday, to_table_wednesday, to_table_thursday, to_table_friday, from_date, to_date)
  File "Flexi_DailyToWeekly.py", line 11, in get_data
  from_date = datetime.datetime.strptime(from_date, '%Y-%m-%d')
  TypeError: strptime() argument 1 must be str, not datetime.date'
  </code></pre>
  
  <p>I've used type(from_date) which returns from_date as a string.</p>
  
  <p>Also tried,</p>
  
  <pre><code>from_date = datetime.datetime.strptime(str(from_date), '%Y-%m-%d').date()
  </code></pre>
  
  <p>still the same error persists.</p>
  
  <p>Changed from_date as suggested in the answers below,</p>
  
  <pre><code>from_date = "2018-01-01"
  </code></pre>
  
  <p>The error persisits,</p>
  
  <pre><code>Traceback (most recent call last):
  File "Flexi_DailyToWeekly.py", line 82, in &lt;module&gt;
  from_date = datetime.datetime.strptime(from_date, '%Y-%m-%d').date()
  File "/usr/lib/python3.5/_strptime.py", line 510, in _strptime_datetime
  tt, fraction = _strptime(data_string, format)
  File "/usr/lib/python3.5/_strptime.py", line 343, in _strptime
  (data_string, format))
  ValueError: time data '"2018-01-01"' does not match format '%Y-%m-%d'
  </code></pre>