What\'s the best way to get the current timestamp in Go and convert to string? I need both date and time in eg. YYYYMMDDhhmmss format.
Use the time.Now() and time.Format() functions (as time.LocalTime() doesn't exist anymore as of Go 1.0.3)
t := time.Now() fmt.Println(t.Format("20060102150405"))
Online demo (with date fixed in the past in the playground, never mind)