A wall clock represents the current time of day, but synchronization such as NTP can make it jump forward or backward. Do not measure durations with it: backward jumps can produce negative durations. A monotonic clock instead moves forward continuously and is not affected by time jumps. section 10.3.2
When JSON changes a time comparison
Calling time.Now() can produce a time.Time containing both wall and monotonic time. JSON preserves the wall time but drops the monotonic value, so comparing the original and unmarshaled structs with == prints false even though they represent the same instant. Use time.Time.Equal for instant comparison, or remove the monotonic component with Truncate(0) before a structural comparison.
Choose the operation according to what the timestamp means:
- Use the wall time to represent calendar or clock time, including values serialized through JSON. section 10.3.2
- Use a monotonic clock for elapsed-time measurement when clock synchronization could otherwise distort the result. section 10.3.2
- Use Equal instead of == when comparing time.Time values that may have different monotonic components. section 10.8




