convert date to go time

This commit is contained in:
Hayden Parker
2016-02-04 00:07:09 -08:00
parent 51e944ec28
commit 7e32bd2458
2 changed files with 12 additions and 3 deletions

View File

@@ -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
View 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))
}