I want to input a date/time into influx db from python but not sure how to do this. Python code datetime.datetime.now()
currently gives out a format like this : 2018-06-25 13:59:36.698000.
I know this format is accepted by influx "1529932431998" which is "2018-06-25T13:13:51.998Z" or "0x1643714427e". Any ideas how i can get python to give me 11 digit number from python?
Thanks
Looks like you need epoch
time.
Try:
import datetime
import time
print( time.mktime(datetime.datetime.now().timetuple()) )
Output:
1529932959.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With