navidrome/utils/time.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
224 B
Go
Raw Normal View History

package utils
import "time"
func ToTime(millis int64) time.Time {
2016-03-09 01:29:56 +01:00
t := time.Unix(0, millis*int64(time.Millisecond))
return t.Local()
}
func ToMillis(t time.Time) int64 {
return t.UnixNano() / int64(time.Millisecond)
}