Skip to content
Snippets Groups Projects
Commit 646f2a6a authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

Merge branch 'test/timestampConversion' into 'release'

Test/timestamp conversion

See merge request !595
parents 0739502e 9a9c9c88
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,9 @@
package bindings
import "gitlab.com/elixxir/client/interfaces/message"
import (
"gitlab.com/elixxir/client/interfaces/message"
)
// Message is a message received from the cMix network in the clear
// or that has been decrypted using established E2E keys.
......@@ -36,10 +38,12 @@ func (m *Message) GetMessageType() int {
}
// Returns the message's timestamp in ms
func (m *Message) GetTimestampMS() int {
return int(m.r.Timestamp.UnixNano()/1000000)
func (m *Message) GetTimestampMS() int64 {
ts := m.r.Timestamp.UnixNano()
ts = (ts+999999)/1000000
return ts
}
func (m *Message) GetTimestampNano() int {
return int(m.r.Timestamp.UnixNano())
func (m *Message) GetTimestampNano() int64 {
return m.r.Timestamp.UnixNano()
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment