How to get current unix epoch time in python that does not go backwards due to system clock backset

251 Views Asked by At

I am using python time module where I get the current unix time with time.time(). However, I am noticing that when I get current time and compare it to a previous time.time() call, the value is lower.

the alternative to this is to use time.monotonic() since it ensures an increase in time always. However Its return value starting point is undefined meaning that is not unix time.

Is there some other call (or module) that gets me a monotonic unix Time or do I have to get current date and time and convert it manually?

0

There are 0 best solutions below