The UNIX Epoch
The UNIX epoch is the number of seconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. (Every day is treated as if it contains exactly 86 400 seconds, so leap seconds must be subtracted since the epoch.)
[Using Epoch to Create a Unique Path File Name]
[Converting Epoch to Human Readable Time]
The epoch can be very useful for universally capturing an exact moment in time and saving it in different, universal ways. It is particularly easy to work with because it requires no parsing whatsoever. Every major language on the planet has a standard function for converting it into any human readable format. It is particularly easy to represent in JSON because it is relatively small compared to other date formats.
💎 Epoch is so much better than strings when dealing with Go JSON files because the zero-value of a
time.Timeis a long-winded string. Plus you can immediately do simple math on the integer value to determine durations for yourself in any language without a strong dependency on a good date format parser.