I have a function
start_time = time.time()
That is producing some wild numbers
i.e.
start time: 1611368981.2445016
That is causing the following error
ValueError: time data '6.9141387939453125e-06' does not match format '%H/%M/%S'
Why is time.time()
producing such wild times and how to get it into normal format?
lines of code in question:
if plant_warning_flag == 0:
start_time = time.time() #start time flag for plant temperature warning
plant_warning_flag = 1
elapsed_time = time.time() - start_time
print("start time: ", start_time)
print('my elapsed time: ', elapsed_time)
newelaptime = time.strptime(str(elapsed_time), "%H/%M/%S")
newmthactime = pd.to_datetime(maxtime_heatac.strip(), format='%H:%M:%S')
if newcread > plant_warning + critical_threshold_ac:
session = requests.Session()
session.post(acserver_url,headers=headers,data=payload)
elif newlaptime > newmthactime:
payload = {'on1':'4000'}
session = requests.Session()
print('peek-a-boo')
how do I retrieve time.time() is regular date format?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…