I have two-hour data they are as strings let first = "09:15" let second = "10:15" how can I do some math actions with these strings? for example I want to do console.log(first - second)
>Solution :
Convert them from String to Date
var dateString = "10:12";
var date = new Date.parseExact(dateString, "HH:mm");
and then you can use : second.diff(first)