0

I get data from open weather api and when i convert it i got the full date i want to extract only the hours :

sunrise: 1607412091 i try this method

var daterise= data.sys.sunrise;
var exactdate= new Date(daterise*1000);
document.getElementById("rise").innerHTML="Sunrise:"+ exactdate;

and i got the full date

Tue Dec 08 2020 08:21:31 GMT+0100 (UTC+01:00)

I want just the hour i want to extract the hours from the date ??

1 Answers1

1
cosnt hours = exactdate.getHours()
Faraz
  • 433
  • 3
  • 7