title: Convert QDate to seconds
body: <p>I take date from <code>QDateTimeEdit</code> and convert it to seconds like this:</p>
  
  <pre><code>import time
  from datetime import datetime
  
  date = self.__ui.dateTimeEdit.date().toString("dd/MM/yy")
  dateString = str(date)
  
  seconds = time.mktime(datetime.strptime(dateString, "%d/%m/%y").timetuple()) 
  </code></pre>
  
  <p>This works well, but since it looks to long to me, my question is: Is it possible to convert <code>self.__ui.dateTimeEdit.date()</code> directly, without those string conversions?</p>
  
  <p><strong>EDIT1</strong>
  Unfortunately <code>toMSecsSinceEpoch()</code> as falsetru suggested, doesn't work for me.</p>
  
  <pre><code>AttributeError: 'QDateTime' object has no attribute 'toMSecsSinceEpoch'
  </code></pre>
  
  <p>I'm using PyQt 4.7.1 for Python 2.6</p>
  
  <p><strong>EDIT2</strong> based on jonrsharpe's answer I've escaped string conversions:</p>
  
  <pre><code>    date = self.__ui.dateTimeEdit.date().toPyDate()
      seconds = time.mktime(date.timetuple()) 
  </code></pre>
  
  <p>result is the same.</p>
  
  <p><strong>EDIT3</strong> even shorter solution based on falsetru's comment:</p>
  
  <pre><code>self.__ui.dateTimeEdit.dateTime().toTime_t()
  </code></pre>