def dt_to_qdatetime ( dt ) : return QtCore . QDateTime ( QtCore . QDate ( dt . year , dt . month , dt . day ) , QtCore . QTime ( dt . hour , dt . minute , dt . second ) )
python qdate object to datetime
Convert a python datetime . datetime object to QDateTime
def dt_to_qdatetime(dt):
    """Convert a python datetime.datetime object to QDateTime

    :param dt: the datetime object
    :type dt: :class:`datetime.datetime`
    :returns: the QDateTime conversion
    :rtype: :class:`QtCore.QDateTime`
    :raises: None
    """
    return QtCore.QDateTime(QtCore.QDate(dt.year, dt.month, dt.day),
                            QtCore.QTime(dt.hour, dt.minute, dt.second))