convert date to go time
This commit is contained in:
@@ -3,8 +3,5 @@ package common
|
||||
// the sha256 of some datastructure
|
||||
type IdentHash [32]byte
|
||||
|
||||
// i2p date time stamp
|
||||
type Date [8]byte
|
||||
|
||||
// i2p bytestring
|
||||
type String []byte
|
||||
|
12
lib/common/date.go
Normal file
12
lib/common/date.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Date [8]byte
|
||||
|
||||
func GoDate(date Date) time.Time {
|
||||
seconds := Integer(date[:]...)
|
||||
return time.Unix(0, int64(seconds*1000000))
|
||||
}
|
Reference in New Issue
Block a user