flâneur — a map of the web's best reading

Golang Time Format Examples [With Explanation] | GoLinuxCloud

golinuxcloud.com · 2,024 words · saved by 1 readers

golang time format yyyy mm dd, milliseconds, hmmss, timezone, rfc3339, utc, golang time parse format

Format turns a time.Time into a string; Parse and ParseInLocation do the reverse. Both use the same idea: the layout is not YYYY-MM-DD —it is spelled with Go’s reference instant so the string you write looks like the string you want out. For clocks, durations, and time.Now without formatting detail, start with Golang time basics . Tested on: Go 1.22 on 64-bit Linux; snippets were run with go run while this article was revised. Quick answer: use the reference date, not YYYY-MM-DD Call t.Format(layout) . For a calendar date like 2026-06-18, the usual layout is 2006-01-02 (year 2006 , month 01 ,

Explore this link on the map →

related reading