Author: Adam <git@apiote.tk>
parse other time of watched in proper timezone
libamuse/account.go | 10 ++++++----
diff --git a/libamuse/account.go b/libamuse/account.go index 6b9386db6b37ac0f8043b1c291d6fac473206984..03f52cefa49814df616661913dceacd14757fc7e 100644 --- a/libamuse/account.go +++ b/libamuse/account.go @@ -120,11 +120,13 @@ var err error = nil if datetime == "" { t = time.Now() } else { - location, _ := time.LoadLocation(result.user.Timezone) - t, err = time.Parse("2006-01-02T15:04:05", datetime) - if !t.IsZero() { - t = t.In(location) + var location *time.Location + if datetime != "0001-01-01T00:00:00" { + location, _ = time.LoadLocation(result.user.Timezone) + } else { + location = time.UTC } + t, err = time.ParseInLocation("2006-01-02T15:04:05", datetime, location) } t = t.In(time.UTC) result.result = t