Convert QDate to seconds

前端 未结 2 662
感情败类
感情败类 2021-01-23 00:06

I take date from QDateTimeEdit and convert it to seconds like this:

import time
from datetime import datetime

date = self.__ui.dateTimeEdit.date().         


        
2条回答
  •  日久生厌
    2021-01-23 00:49

    The QDate you get from

    self.__ui.dateTimeEdit.date()
    

    has another method toPyDate that will save you the round trip through a string.

提交回复
热议问题