def testQDate(self): date = datetime.date(2010, 4, 23) other = QDate(date) self.assertEqual(date.year, other.year()) self.assertEqual(date.month, other.month()) self.assertEqual(date.day, other.day()) self.assertEqual(date, other.toPython())
def fromQDateToDate(qdate: QDate) -> date: return qdate.toPython()
def fromQDateAndQTime(qdate: QDate, qtime: QTime): native_date = qdate.toPython() native_time = qtime.toPython() return datetime.combine(native_date, native_time)