diff options
| author | bt <bt@rctt.net> | 2026-06-04 16:11:03 +0200 |
|---|---|---|
| committer | bt <bt@rctt.net> | 2026-06-04 16:12:22 +0200 |
| commit | ed2621c17f353878ea86ce2c16cac7cd04fb4c6a (patch) | |
| tree | 21735f781749a3b2986fb8fbd44e9a3ef94d8a66 /core/data.go | |
| parent | 061b0ac8e8d1cefbb7ffcf3eb8695a28663cda3e (diff) | |
| download | solec-ed2621c17f353878ea86ce2c16cac7cd04fb4c6a.tar.gz solec-ed2621c17f353878ea86ce2c16cac7cd04fb4c6a.zip | |
[common] Include milliseconds in timestamps
Diffstat (limited to 'core/data.go')
| -rw-r--r-- | core/data.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/data.go b/core/data.go index fdad424..6871a89 100644 --- a/core/data.go +++ b/core/data.go @@ -93,7 +93,7 @@ func Encode(w Wrapper) ([]byte, error) { } case time.Time: - err := binary.Write(buf, binary.BigEndian, uint64(v.Unix())) + err := binary.Write(buf, binary.BigEndian, uint64(v.UnixMilli())) if err != nil { return []byte{}, fmt.Errorf("cannot encode time: %v", err) } @@ -168,7 +168,7 @@ func decodeTime(buf io.Reader, ptr *time.Time) error { return fmt.Errorf("cannot decode time: %v", err) } - *ptr = time.Unix(int64(timeBuf), 0) + *ptr = time.UnixMilli(int64(timeBuf)) return nil } |
