How can I turn this const time conversion formula into a reusable function? [duplicate]

I’ve been trying to turn the following simple millisecond to “minutes and seconds” conversion into a function. I’d like to use a function so I can easily send the milliseconds as a parameter and then return the formatted minutes and seconds.

const date = new Date(123456);
`${date.getMinutes()} minutes ${date.getSeconds()} seconds`; // Expected result: "2 minutes 3 seconds"

For the life of me I can’t figure it out. I’m both seeking a short term solution and also an reason this isn’t as simple as it seems, as I’m still very new to learning JavaScript.