forked from free-lancers/electricity_bill_calc_service
feat(user):完成用户部分所有接口的迁移。
This commit is contained in:
@@ -4,14 +4,18 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var loc *time.Location = time.FixedZone("+0800", 8*60*60)
|
||||
var Loc *time.Location = time.FixedZone("+0800", 8*60*60)
|
||||
|
||||
func Now() time.Time {
|
||||
return time.Now().In(loc)
|
||||
return time.Now().In(Loc)
|
||||
}
|
||||
|
||||
func Time(year int, month time.Month, date, hours, min, sec, nsec int) time.Time {
|
||||
return time.Date(year, month, date, hours, min, sec, nsec, Loc)
|
||||
}
|
||||
|
||||
func Timestamp() int64 {
|
||||
startline := time.Date(2022, 2, 22, 22, 22, 22, 0, loc).Unix()
|
||||
startline := time.Date(2022, 2, 22, 22, 22, 22, 0, Loc).Unix()
|
||||
return Now().Unix() - startline
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user