mirror of
https://github.com/navidrome/navidrome.git
synced 2024-08-30 22:36:02 +02:00
13 lines
224 B
Go
13 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)
|
|
}
|