lestrrat-go / strftime

Fast strftime for Go
MIT License
117 stars 22 forks source link

strftime replaces `pm` to `am` when AM time is passed to FormatString #5

Closed sivasamyk closed 6 years ago

sivasamyk commented 6 years ago

The below code when run at 4 PM IST prints. See that in second case when the time passed is AM apm string is replaced by aam

/opt/apm/apm-test/logs/apm.log.20180821
/opt/aam/aam-test/logs/aam.log.20180821
p, _ := strftime.New("/opt/apm/apm-test/logs/apm.log.%Y%m%d")
now := time.Now()
fmt.Println(p.FormatString(now))
fmt.Println(p.FormatString(now.Add(6 * time.Hour * -1)))
lestrrat commented 6 years ago

Thank you, fixed!