Browse Source

Fix unixnano marshaling of timestamps

Matt Heath 10 years ago
parent
commit
10c63fdbeb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      marshal.go

+ 1 - 1
marshal.go

@@ -802,7 +802,7 @@ func marshalTimestamp(info TypeInfo, value interface{}) ([]byte, error) {
 	case int64:
 		return encBigInt(v), nil
 	case time.Time:
-		x := v.UnixNano() / int64(1000000)
+		x := int64(v.UTC().Unix()*1e3) + int64(v.UTC().Nanosecond()/1e6)
 		return encBigInt(x), nil
 	}
 	rv := reflect.ValueOf(value)