So I have numerous structs which extend the gorm Model meaning they have createdAt, updatedAt and deletedAt time.Time fields. When I go to marshal these into JSON, the formats of the dates I receive vary. The proper RFC3339 timestamps it should produce look like:
2016-04-18T00:03:20Z
However, I am only getting dates formatted this way about 20% of the time. The remainder of the timestamps have a variable number of subseconds. I have received the following formats:
2016-04-18T05:51:11.54772087Z
2016-04-18T05:51:11.543835101Z
2016-04-18T05:53:20.1674444Z
Is there any way I can coerce Go into to giving me consistent timestamps? Thanks in advance!