I need to convert a date input by a QCalendar to datetime (from the datetime lib). How can I do it?
I need to convert a date input by a QCalendar to datetime (from the datetime lib). How can I do it?
QDateTime has a toPyDateTime function that returns a datetime
from PyQt5.QtCore import QDate, QDateTime
#usando Date
QDate.currentDate().toPyDate()
datetime.date(2017, 3, 17)
#usando DateTime
QDateTime.currentDateTime().toPyDateTime()
datetime.datetime(2017, 3, 17, 19, 9, 45, 974000)