-1

I have a dataset, myTable, that has ISO 8601 time/date values. It looks like this:

username    minTime                     maxTime
Alice       2018-09-24T17:49:31.67Z     2018-10-03T20:07:05.216Z
John        2018-08-13T17:38:21.37Z     2018-10-03T20:04:15.312Z

I want to find the time duration (the difference between maxTime and minTime for each username). I checked out this post but it only applies to C++ and requires using regex. I was wondering if there was a simpler way or library function that could find the time duration in ISO 8601 format?

Anna
  • 379
  • 5
  • 16

1 Answers1

0

You can use dateutil to parse string in to datetime object. Once you have a datetime object, you can simply subtract them,

diff = maxTime - minTime
Sufiyan Ghori
  • 18,164
  • 14
  • 82
  • 110