Per the documentation, the
m value is the monotonic clock value, which can be removed using
Truncate for comparisons not for the purpose of timing. The
m field does not match because it is omitted from JSON, it is only generated by
Try like so:
// values now := time.Now().Truncate(0) // Truncate to remove monotonic clock portion timeToJSON, _ := json.Marshal(now) var obj time.Time json.Unmarshal(timeToJSON, &obj)
The monotonic clock offset was added in order to allow for accurate timing of durations which span a wall clock change (e.g. NTP update, DST change, or leap second/smear).