How do I display the current year?

It’s just a strange syntax for specifying date format… think 1, 2, 3, 4, 5, 6, 7:

Number Meaning Examples
1 month 01, Jan, January
2 day 02, Mon, Monday
3 hour 03, 15
4 minute 04
5 seconds 05
6 year 06, 2006
7 timezone -0700, -07:00, -07, MST

References:


Update: Just blogged about this – Time formatting in Go

4 Likes