I am trying to format time using time Format function as MMM dd yyyy, HH:mm:ss format but getting incorrect date as output. Below is the code for reference
package main
import (
"fmt"
"time"
)
func main() {
var t time.Time
t = time.Now()
fmt.Println(t.Format("Jan 01 2006, 15:04:05"))
//Output
//Dec 12 2018, 16:27:34
}
But if I change the reference format as Jan 02 2006, 15:04:05
I get a correct output. So I am not able to find what is the issue between two dates reference and what would be the correct reference date format which works in all use case.