1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: wrongly displayed timezone offset

This commit is contained in:
Ferdinand Mütsch
2022-01-02 20:25:07 +01:00
parent f69dce39d8
commit 8b8c5675af
4 changed files with 12 additions and 2 deletions

View File

@ -90,6 +90,8 @@ func (u *User) TZ() *time.Location {
return tz
}
// TZOffset returns the time difference between the user's current time zone and UTC
// TODO: is this actually working??
func (u *User) TZOffset() time.Duration {
_, offset := time.Now().In(u.TZ()).Zone()
return time.Duration(offset * int(time.Second))