Wanderlust - Step 40 question

Hello there.

While doing the Wanderlust project, I decided to get a bit uncomfortable and try to practice stuff I haven’t used in a while.

So, as in the step 40. is a bit vague “Include additional information about the weather.”, I decided to look for a celsius converter and some Date stuff → such as displaying the Sunrise & Sunset time.

const createWeatherHTML = (currentDay) => {
  const sunrise = new Date(currentDay.sys['sunrise']);
  const sunset = new Date(currentDay.sys['sunset']);
  const sunriseTime = `${sunrise.getHours()}:${sunrise.getMinutes()}`;
  const sunsetTime = `${sunset.getHours()}:${sunset.getMinutes()}`;
  return `<h2>${weekDays[(new Date()).getDay()]}</h2>
		<h2>Temperature: ${kelvinToCelsius(currentDay.main.temp)}&deg;C</h2>
		<h2>Condition: ${currentDay.weather[0].description}</h2>
    <h2>Sunrise: ${sunriseTime}</h2>
    <h2>Sunset: ${sunsetTime}</h2>
  	<img src="https://openweathermap.org/img/wn/${currentDay.weather[0].icon}@2x.png">`;

The issue I have with this is that although it clearly states 2 different unix times:

It renders the same time here:

I’m pretty sure it must be something wrong in my createWeatherHTML function but I honestly can’t figure out what went wrong.

Can you guys show me your train of thought on this one?

Thanks a lot in advance.

Found it!

Unix counts in seconds from Epoch. Javascript counts in miliseconds.

Hence, if I multiply sunrise*1000, it will return the expected date.