Exemplo n.º 1
0
 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("下午好")
Exemplo n.º 2
0
 def showtime(self):
     datetime = QDateTime.currentDateTime()
     timetext = datetime.toString()
     self.timeLabel.setText(timetext)
Exemplo n.º 3
0
 def showCurrTime(self):
     datetime = QDateTime.currentDateTime()
     self.timeLabel.setText("     " + datetime.toString())
Exemplo n.º 4
0
 def datetimeToJSON(datetime):
     u"""
     :type datetime: QDateTime
     """
     return forceString(datetime.toString('yyyy-MM-ddThh:mm:ss'))
Exemplo n.º 5
0
 def showtime(self):  #时间显示
     datetime = QDateTime.currentDateTime()
     text = datetime.toString()
     self.label.setText(text)
     self.label.setFont(QFont("Roman times", 16, QFont.Bold))