[英]How to calculate total minutes in current time Python
我想获取当前时间的总分钟数
从时间导入 gmtime, strftime
class 时间:
def __init__(self,hours,minutes):
self.hours=hours
self.minutes=minutes
print('{} hour {} minutes'.format(self.hours,self.minutes))
@staticmethod
def time():
now = datetime.now()
current = now.strftime("%H:%M:%S")
print("Current Time =", current)
def current_time(self):
pass
t=时间(1,2) t.time()
from datetime import datetime
now = datetime.now()
print(now.hour, now.minute, now.second)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.