0

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?

Faheem azaz Bhanej
  • 2,328
  • 3
  • 14
  • 29
  • 1
    i know mate i was looking for it for reallly long, but my english is not really good, and I think i missed it. Thank you for help! – Waffles Apr 07 '22 at 09:22
  • You have to put button to get values from input type date. When click on button get value – Faheem azaz Bhanej Apr 07 '22 at 09:24
  • i know, i am getting the values, I just didnt knew how to transform them from just some random characters into date, but now i know it. Thank you for help! – Waffles Apr 07 '22 at 09:26

0 Answers0