1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-20 09:56:49 +02:00

Adding src/utils/time.go

This commit is contained in:
Henrik Hautakoski 2022-08-18 12:01:14 +02:00
parent c8a128b657
commit d3d0fb11d7
No known key found for this signature in database
GPG key ID: 608414D93E862CCD
2 changed files with 48 additions and 0 deletions

22
src/utils/time.go Normal file
View file

@ -0,0 +1,22 @@
package utils
import (
"time"
)
type Time struct {
ts time.Time
}
func (t *Time) SetTime(value time.Time) {
t.ts = value
}
func (t Time) GetTime() time.Time {
if ! t.ts.IsZero() {
return t.ts
}
return time.Now().In(time.UTC)
}