Question:I am making a request to one of server and getting response like this:
In python, if I convert the current time into a timestamp, it looks like this:
Answer:We know that
datetime.now().strftime("%s%f")is a timestamps measured in microseconds (since
%sis seconds and
1655375242179881are the same length, which suggests your source data is also a timestamp measured in microseconds. (The fact that the last three digits are always
000suggests that it was originally derived from a source with milliseconds precision, but the value is clearly microseconds).
We can use
However this expects a time in seconds, “as returned by
So we can:
datetime.datetime(2022, 6, 16, 11, 26, 56, 687000)
If you have better answer, please add a comment about this, thank you!