So I got a project in school to make BMI calculator, but not a standard one, but with some pretty fancy stuff around it. One of those functionalities is date of starting
, date of ending
and time between them
.
var t_start = document.getElementById("t_start").value;
console.log(t_start);
var t_end = document.getElementById("t_end").value;
console.log(t_end);
<label for="t_start">Starting date:</label><br>
<input type="date" id="t_start" name="t_start"><br><br>
<label for="t_end">Ending date:</label><br>
<input type="date" id="t_end" name="t_end"><br><br>
And so the variable t_start
are looking like this: 2020-02-13 (y-m-d)
I was wondering, how to transform them into date or do anything to count days between them?