Im trying to parse date with custom format- ddmmmyyyy
. for example:
15may1997
dd 15
mmm may
yyyy 1997
This is my code:
const customFormat = "02jan2006"
t, err := time.Parse(customFormat, "15may1997")
if err != nil {
fmt.Println(err)
}
And this is the output:
parsing time "15may1997" as "02jan2006": cannot parse "may1997" as "jan"
The parsing succeed only when changing the day:
t, err := time.Parse(customFormat, "15jan2006")
I have tried to read this and this and more articles, but couldn't figure out how to custom to my format.
What am I doing wrong here?
Thanks.