当前时间格式化到pyqt5
self.de_endtime.setDateTime(QDateTime.fromString(time.strftime("%Y/%m/%d", time.localtime()), 'yyyy/MM/dd'))
now_day = time.strftime("%Y/%m/%d %H:%M", time.localtime(result['starttime'])) # python获取格式化日期时间
print(now_day)
self.de_starttime.setDateTime(QDateTime.fromString(now_day, 'yyyy/MM/dd hh:mm'))
timestr = "2019-04-25 10:59:30"
timeArray = time.strptime(timestr,"%Y-%m-%d %H:%M:%S")
print(timeArray)
otherStyle = time.strftime("%Y:%m:%d-%H:%M:%S",timeArray)
self.de_testtime.setDate(QDate.fromString('2020/07/21', 'yyyy/MM/dd'))