How to parse time seconds to the clock format in Golang?
For example:
input: 0 => output: '12:00 AM'
input: 60 => output: '12:01 AM'
input: 60*60 => output: '1:00 AM'
How to parse time seconds to the clock format in Golang?
For example:
input: 0 => output: '12:00 AM'
input: 60 => output: '12:01 AM'
input: 60*60 => output: '1:00 AM'
Put the number of seconds into the time.Date
function:
t := time.Date(0, 0, 0, 0, 0, sec, 0, time.UTC)
fmt.Println(t.Format("03:04 PM"))