def Show_Time(self): datetime = QDateTime.currentDateTime() text = datetime.toString() self.label_10.setText(text) hour = QTime.currentTime().hour() if hour < 4 or hour > 18: self.label_2.setText("晚上好!") elif hour < 10: self.label_2.setText("早上好") elif hour < 13: self.label_2.setText("中午好") else: self.label_2.setText("下午好")
def showtime(self): datetime = QDateTime.currentDateTime() timetext = datetime.toString() self.timeLabel.setText(timetext)
def showCurrTime(self): datetime = QDateTime.currentDateTime() self.timeLabel.setText(" " + datetime.toString())
def datetimeToJSON(datetime): u""" :type datetime: QDateTime """ return forceString(datetime.toString('yyyy-MM-ddThh:mm:ss'))
def showtime(self): #时间显示 datetime = QDateTime.currentDateTime() text = datetime.toString() self.label.setText(text) self.label.setFont(QFont("Roman times", 16, QFont.Bold))