I'm currently working on a flight entertainment system project that contains a timer that specifies how long is left in the flight. I want to write a function that specifies a certain time such as "3 hours 20mins" and countdown from that. I need it to run from when I open the page and reset it automatically whenever it hits 0. Its really just there for aesthetics. It can be seen in the top right of the image I attached.
Right now I just have regular text in my HTML file :
<div class="flighttime">
3H 20M
</div>