title: How to convert a full length date with time to just date?
body: <p>I have a date that is retrieved when the user clicks on a specific date from a calendar widget. 
  For example, if the user was to press 29th march the program outputs:</p>
  
  <pre><code>2017-03-29 00:00:00
  </code></pre>
  
  <p>When I want </p>
  
  <pre><code>2017-03-29
  </code></pre>
  
  <p>How do I fix it so I can use it with SQLite (same form as second example).</p>
  
  <pre><code>    def datefunction(self,agro):
          print(agro)
          timeslot = cursor.execute('''SELECT * FROM dates WHERE Date = (?)''',(agro,))
          print('''SELECT * FROM dates WHERE Date = (?)''',(agro,))
          list1 = list(cursor.fetchall())
          print(list1)
          if list1== ([]):
              print("You have nothing on today.")
  
      def _show_selection(self, text, bbox):
          """Configure canvas for a new selection."""
          agro = self.selection
          print(self.selection, self.datefunction(agro))
          print(agro)
  </code></pre>
  
  <p>result I get from code:</p>
  
  <pre><code>SELECT * FROM dates WHERE Date = (?) (datetime.datetime(2017, 3, 29, 0, 0),)
  </code></pre>