usermngmt/internal/time.go

21 lines
451 B
Go
Raw Permalink Normal View History

2021-11-10 01:44:22 +00:00
package internal
2021-11-08 04:53:03 +00:00
import "time"
//
// NOTE: due to unique timezone in server's code, all using time will be convert to HCM timezone (UTC +7)
// All functions generate time, must be call util functions here
// WARNING: don't accept call time.Now() directly
//
// getHCMLocation ...
func getHCMLocation() *time.Location {
l, _ := time.LoadLocation(timezoneHCM)
return l
}
2021-11-10 01:44:22 +00:00
// Now ...
func Now() time.Time {
2021-11-08 04:53:03 +00:00
return time.Now().In(getHCMLocation())
}