MCPcopy Create free account
hub / github.com/Musish/Musish / getTime

Function getTime

src/app/utils/Utils.ts:34–42  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

32}
33
34export function getTime(ms: number) {
35 if (!ms || isNaN(ms)) {
36 ms = 0;
37 }
38 const s = 1000 * Math.round(ms / 1000);
39 const d = new Date(s);
40
41 return `${d.getUTCMinutes()}:${String(`0${d.getUTCSeconds()}`).slice(-2)}`;
42}
43
44export function humanifyMillis(duration: number) {
45 const musickitDuration = MusicKit.formattedMilliseconds(duration);

Callers 3

getCurrentPlaybackTimeFunction · 0.90
TracksListItemFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected