I am getting the error hour out of range
while trying to parse a timestamp string with the following code:
package main
import (
"log"
"time"
)
func main() {
layout := "2006-01-02 15:04:05 +0530"
timeStr := "2020-05-23 22:55:51 +0530"
t, tErr := time.Parse(layout, timeStr)
log.Printf("Layout: %s", layout)
log.Printf("Time (string): %s", timeStr)
log.Printf("Time (time.Time): %s", t.String())
if tErr != nil {
log.Printf("Error: %s", tErr.Error())
}
}
Playground: https://goplay.space/#SIWJWKduPQg
Repeat of / Similar to: Hour out of range on time.parse in golang