Created
May 6, 2018 05:12
-
-
Save davidas13/4c18f85648fd1bdc46e189f936ff8bb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PyQt5.QtCore import QDate, QTime, QDateTime, Qt | |
| now = QDate.currentDate() | |
| print(now.toString(Qt.ISODate)) | |
| print(now.toString(Qt.DefaultLocaleLongDate)) | |
| print(now.toString(Qt.DefaultLocaleShortDate)) | |
| date_time = QDateTime.currentDateTime() | |
| print(date_time.toString()) | |
| time = QTime.currentTime() | |
| print(time.toString(Qt.DefaultLocaleLongDate)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PyQt5.QtCore import QDateTime, Qt | |
| now = QDateTime.currentDateTime() | |
| print("Local datetime: ", now.toString(Qt.ISODate)) | |
| print("Universal datetime: ", now.toUTC().toString(Qt.ISODate)) | |
| print("The offset from UTC is: {0} seconds".format(now.offsetFromUtc())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment