Skip to content
Advertisement

Python embedded. timestamp() return same time over multiple seconds

I have implemented a system of callbacks. I want to display the time in unix epoch when I call the function.

For example:

JavaScript

In game:

JavaScript

Why datetime.now().timestamp() return same time? The same problem with time.time()

I use Python 3.8 x32

Advertisement

Answer

The type of a timestamp is float, which is a floating point type of the width of the Python build. A 32-bit float is not sufficient to express the timestamp with second precision:

JavaScript

Use a 64-bit build if the full precision is needed.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement