I am using a jQuery stopwatch that outputs time in the format: 02:45:03. However, I need to save the value in the database as minutes. Can anyone tell me how I can convert such a value into minutes? Or, are you aware of any stopwatch that I can use that displays the time in minutes and I would be able to toggle it (pause/resume) and delete instance completely?
I am using a jQuery stopwatch that outputs time in the format: 02:45:03 .
Share
You can use a fake date to parse the time string into a
Dateobject; and then use theDateobject’s methods to extract the hours and minutes and add them together: