I just trying to get year and month from a timestamp field in a jsong string downloaded from a url.
For example
package main
import (
“fmt”
“time”
)func main() {
m1 := int64(1560207582311)
t1 := time.Unix(m1, 0)m2 := int64(1532009163)
t2 := time.Unix(m2, 0)fmt.Println(t1.Format(“2006-01-02”))
fmt.Println(t2.Format(“2006-01-02”))
}
But I got this :
51411-01-05 // m1
2018-07-19 // m2
m2 is taken from a sample in the web, and it woirks fine but m1 is from the json loaded from url.
Any hint ?
Regards,
Yamil