this only applies if you carry over physical time from one machine to another, assuming perfect physical synchronization of time.
if you stick to a single source of truth - only one machine's time is used as a source of truth - then the problem disappears.
for example instead of using java/your-language's time() function (which could be out of sync across different app nodes) just use database's internal CURRENT_TIMESTAMP() when writing to db.
another alternative is compare timestamps with up to 1 minute/hour precision, if you carry over time from one machine to another. That way you have a a buffer of time for different machines to synchronize clocks over NTP