Still new to this. I have tried to convert a 13 digit timestamp to something that you can read but to no luck. What i am doing is sampling temperature data from a building automation system. This is the code that i am working with. I am missing something very simple. Can i get a poke in the right direction.
when_updated=driver.find_element_by_name("_lastUpdated")
timestamp=when_updated.get_attribute("value")
print("Timestamp:", timestamp)
nos=10 # Number of samples
freq=5 # Sampling frequency
print("\nTemperature & timestamp, sampled every", freq, "seconds:")
while True:
ts=driver.find_element_by_name("_lastUpdated").get_attribute("value")
print("\nTemperature: ", element.text, "read at:", ts)
time.sleep(freq)
driver.switch_to_default_content()
OUTPUT
Temperature:
Timestamp: 0
Temperature & timestamp, sampled every 5 seconds:
Temperature: read at: 0
Temperature: 21.0 ºC read at: 1520912895599
Temperature: 21.0 ºC read at: 1520912901432
Temperature: 21.0 ºC read at: 1520912907070
Python 2
time
module: https://docs.python.org/2/library/time.html