Build a Weather App from Scratch with Next.js

Hi everyone! Can someone help me?
When consuming the data from the API , I have problems with a function that is in charge of obtaining the data from OpenWeatherMap API ( to give it date and time format.
The problem function is in the converters.js file and is:

export const unixToLocalTime = (unixSeconds, timezone) => {
    let time = new Date((unixSeconds + timezone) * 1000)
     return time.startsWith("0") ? time.substring(1) : time;

Could someone give me some guidance on how to solve this issue? Thank you very much in advance!!!