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:
@ -107,6 +107,12 @@ func FmtWakatimeDuration(d time.Duration) string {
|
||||
return fmt.Sprintf("%d hrs %d mins", h, m)
|
||||
}
|
||||
|
||||
// LocalTZOffset returns the time difference between server local time and UTC
|
||||
func LocalTZOffset() time.Duration {
|
||||
_, offset := time.Now().Zone()
|
||||
return time.Duration(offset * int(time.Second))
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/18632496
|
||||
func firstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time {
|
||||
date := time.Date(year, 0, 0, 0, 0, 0, 0, timezone)
|
||||
|
Reference in New Issue
Block a user