mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 04:27:37 +03:00
12 lines
224 B
Go
12 lines
224 B
Go
package utils
|
|
|
|
import "time"
|
|
|
|
func ToTime(millis int64) time.Time {
|
|
t := time.Unix(0, millis*int64(time.Millisecond))
|
|
return t.Local()
|
|
}
|
|
|
|
func ToMillis(t time.Time) int64 {
|
|
return t.UnixNano() / int64(time.Millisecond)
|
|
}
|