import time

start_time = time.mktime((2023, 2, 22, 0, 0, 0, 0, 0, 0))
end_time = time.mktime((2023, 2, 23, 0, 0, 0, 0, 0, 0))

while start_time < end_time:
    current_time = time.localtime(start_time)
    print(time.strftime("%Y-%m-%d %H:%M:%S", current_time))
    start_time += 1
    
print("Time's up!")
编写一段python代码时间从2023年2月22日0:0:0开始计时到2023年2月23提0:0:0结束

原文地址: https://www.cveoy.top/t/topic/b168 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录