JSFiddle - React, Tailwind, and code Playground

HTML

<span id="timeRemaining"></span>

<div> <span>How much of the day has passed:</span>

    <progress id="dayProgression" value="0"></progress>
</div>

JavaScript

const DAY = 60 * 60 * 1000; // hours*minutes*seconds*milliseconds

var today = new Date(Date.now());

var nextDay = new Date(actualTime.getFullYear(), actualTime.getMonth(), actualTime.getDate() + 1, 0, 0, 0);



var diffhour = DAY - (nextDay.getTime() - today.getTime());

document.getElementById('timeRemaining').appendChild(document.createTextNode(diffhour + " test" ));

document.getElementById('dayProgression').value = 1 - (timeRemaining / 1000 / 60 / 60 / 24);