码迷,mamicode.com
首页 > 其他好文 > 详细

pyqt中QDateTimeEdit/QDateEdit相关使用方法

时间:2015-07-17 17:46:00      阅读:727      评论:0      收藏:0      [点我收藏+]

标签:

QDateTimeEdit/QDateEdit

clear (self)
QDate date (self)
QDateTime dateTime (self)
setDate (self, QDate date)
setDateTime (self, QDateTime dateTime)
setTime (self, QTime time)
QTime time (self)

 

now_day = time.strftime("%Y-%m-%d", time.localtime())
self.dateEdit.setDate(QDate.fromString(now_day, ‘yyyy-MM-dd‘))

 

now_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
self.dateTimeEdit.setDateTime(QDateTime.fromString(now_time, ‘yyyy-MM-dd hh:mm:ss‘))

 

QDate

QDate currentDate ()
QDate fromString (QString s, QString format)
QString toString (self, QString format)
(int year, int month, int day) getDate (self)
int day (self)
int month (self)
int year (self)

QDateTime

QDateTime currentDateTime ()
QDateTime fromString (QString s, QString format)
QString toString (self, QString format)
QDate date (self)
QTime time (self)

 

start_time = self.dateTimeEdit.dateTime()
end_time = self.dateTimeEdit_2.dateTime()

pyqt中QDateTimeEdit/QDateEdit相关使用方法

标签:

原文地址:http://www.cnblogs.com/hushaojun/p/4654712.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!