Trouble converting int64 to timestamp

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 (

func main() {
m1 := int64(1560207582311)
t1 := time.Unix(m1, 0)

m2 := int64(1532009163)
t2 := time.Unix(m2, 0)


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 ?


As you can see by the order of magnitude of the input, m1 is probably a timestamp in milliseconds or indeed a date that is 49000 years in the future.

1 Like



I did not read time documentation clearly…
Thanks a lot!!!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.