wrapper for mobile
This commit is contained in:
commit
8d300e4782
17 changed files with 1763 additions and 0 deletions
25
time.go
Normal file
25
time.go
Normal 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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue