update
This commit is contained in:
parent
ccbd60cf58
commit
95fab6ac26
@ -1,4 +1,4 @@
|
||||
user_name: 冯博涵
|
||||
project_name: [nb2337,nb2353]
|
||||
project_leader: [罗伟,何进]
|
||||
project_name: [nb2426]
|
||||
project_leader: [李夏禹]
|
||||
template_file_name: 2017WWXX周工作报告样本.doc
|
15
time.py
Normal file
15
time.py
Normal file
@ -0,0 +1,15 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
def hours_until_5_20():
|
||||
now = datetime.now()
|
||||
target_time = datetime(now.year, now.month, now.day, 17, 20) # 设置目标时间为当天的17:20
|
||||
|
||||
#if now > target_time: # 如果当前时间已经过了今天的目标时间
|
||||
# target_time += timedelta(days=1) # 将目标时间设置为明天的同一时间
|
||||
|
||||
time_difference = now -target_time
|
||||
hours_difference = time_difference.total_seconds() / 3600 # 将时间差转换为小时
|
||||
return hours_difference
|
||||
|
||||
# 调用函数并打印结果
|
||||
print("Time until 5:20 is: {0:.2f} h".format(hours_until_5_20()))
|
Loading…
x
Reference in New Issue
Block a user