QDateTime计算时间差
QDateTime计算时间差
from PyQt5.QtCore import QDateTime # Create two QDateTime objects dt1 = QDateTime.currentDateTime() dt2 = QDateTime(2022, 1, 1, 0, 0) # Calculate the difference in seconds diff_seconds = dt1.secsTo(dt2) print(f'The difference in seconds is {diff_seconds}')
#####################
QQ 3087438119