Skip to content

Commit

Permalink
Update datetime marshal to use UnixNano() (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRangiCrew authored Nov 22, 2024
1 parent 184f6bf commit fffe8a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/models/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ type CustomDateTime struct {
func (d *CustomDateTime) MarshalCBOR() ([]byte, error) {
enc := getCborEncoder()

totalNS := d.Nanosecond()
totalNS := d.UnixNano()

s := totalNS / constants.OneSecondToNanoSecond
ns := totalNS % constants.OneSecondToNanoSecond

return enc.Marshal(cbor.Tag{
Number: TagCustomDatetime,
Content: [2]int64{int64(s), int64(ns)},
Content: [2]int64{s, ns},
})
}

Expand Down

0 comments on commit fffe8a0

Please sign in to comment.