wrapper for mobile

This commit is contained in:
zhj4478 2018-06-04 16:05:14 -07:00
commit 8d300e4782
17 changed files with 1763 additions and 0 deletions

25
time.go Normal file
View file

@ -0,0 +1,25 @@
package pm
import (
"time"
)
// UpdateTime update cached time
func (o *OpenPGP) UpdateTime(newTime int64) {
o.lastestServerTime = newTime
}
//GetTime get latest cached time
func (o *OpenPGP) GetTime() int64 {
return o.lastestServerTime
}
func (o *OpenPGP) getNow() time.Time {
if o.lastestServerTime > 0 {
tm := time.Unix(o.lastestServerTime, 0)
return tm
}
return time.Now()
}