查找24小時之間是否經(jīng)過了日期-Python我有以下方法:# last_updated is a datetime() object, representing the last time this program randef time_diff(last_updated):
day_period = last_updated.replace(day=last_updated.day+1, hour=1,
minute=0, second=0,
microsecond=0)
delta_time = day_period - last_updated
hours = delta_time.seconds // 3600
# make sure a period of 24hrs have passed before shuffling
if hours >= 24:
print "hello"
else:
print "do nothing"我想知道從那以后24小時是否已經(jīng)過去了last_updated,我怎么能在Python?
查找24小時之間是否經(jīng)過了日期-Python
慕田峪9158850
2019-06-14 16:00:34