Go Cheatsheet - Date & Time
Date & Time
Get current date & time
now := time.Now()
// get current timestamp
ts := now.Unix()
// get current timestamp nano
ts := now.UnixNano()
Format
now.Format("Monday January 2, 2006")
now.Format("01/02/2006 15:04:05")
now.Format("01/02/2006 3...
hn.0xbf.me1 min read