~/Golang Datetime Format Handling
Sep 16, 2021
Dealing with datetime in Go relies on the time package. Go uses a unique reference time, Mon Jan 2 15:04:05 MST 2006
, for parsing and formatting times.
Parsing a datetime string:
Formatting a time.Time
object:
For time zones, use time.LoadLocation
:
Always remember the layout must match the input or output format exactly. For a complete reference, use the official Go time documentation.