Skip to content
Advertisement

Converting time to take away

Hiya so I have a data frame which has the time something occurs in one column and the time that it ends in the next column. I need to try and find the time difference between the two, but theyre both strings so it wont simply let me compare them, is there a way I can change them to ints (theyre in the format HH:MM:SS) I found a way to split them using .split (I’ve put what I did for the original time below, the I could do the same for the second column and work them out from there, but I was wondering if there was an easier way?
… TIA!

JavaScript

Advertisement

Answer

Here’s a simple function I wrote, you can take a look at it and tell me if you don’t understand anything: https://repl.it/@d4nieldev/subtract-time

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement