I have the following code:
import datetime
time_stamp = datetime.datetime.utcnow()
print(time_stamp)
This returns the following:
2021-04-16 11:06:16.867390
I would like to convert the entire timestamp, including the microseconds (ie. all 6 decimal places) to a unique hex number. How can i do this (preferably on one line if it exists) ?
Similar solutions are here: Getting a datetime in this format and converting to 4 byte hex . However, they do not include the decimal part of the utcnow()
return function which in this case is important as it is expected to create a different hex for each microsecond change.