update constant
This commit is contained in:
parent
61c80de59d
commit
dc7fa0ba79
|
@ -38,7 +38,7 @@ func (s Service) Create(payload CreatePayload) {
|
||||||
ID: payload.Author.ID,
|
ID: payload.Author.ID,
|
||||||
Name: payload.Author.Name,
|
Name: payload.Author.Name,
|
||||||
},
|
},
|
||||||
CreatedAt: Now(),
|
CreatedAt: now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert to db
|
// Insert to db
|
||||||
|
|
10
time.go
10
time.go
|
@ -10,13 +10,13 @@ import "time"
|
||||||
|
|
||||||
const timezoneHCM = "Asia/Ho_Chi_Minh"
|
const timezoneHCM = "Asia/Ho_Chi_Minh"
|
||||||
|
|
||||||
// GetHCMLocation ...
|
// getHCMLocation ...
|
||||||
func GetHCMLocation() *time.Location {
|
func getHCMLocation() *time.Location {
|
||||||
l, _ := time.LoadLocation(timezoneHCM)
|
l, _ := time.LoadLocation(timezoneHCM)
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now ...
|
// now ...
|
||||||
func Now() time.Time {
|
func now() time.Time {
|
||||||
return time.Now().In(GetHCMLocation())
|
return time.Now().In(getHCMLocation())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue