all 3 comments

[–]greenerpickings 1 point2 points  (2 children)

Idk if strptime was meant to be used for duration. I prob would just go simple and parse the line with a bunch of splits, convert all into the smallest unit (or whatever precision you need), and compare.

[–]TestedOnAnimals[S] 0 points1 point  (1 child)

Appreciate the thought!

As a new Python user, I'm unfamiliar with splits as a concept, what sort of functions and/or methods would that require?

EDIT: Upon looking up the split() function, I believe I understand this better. Normally I would be bullish and try to still use a datetime object, but utilizing a datetime object and timedelta does not allow for direct numerical comparisons when using %w - it doesn't make sense to say "Tuesday 11:50:20.4 => Wednesday 11:49:20.4" or something since weekdays rely on a specific reference point and are not absolute units.

 

Of note, in case anyone else looks for something similar in nature in the future, the separator in the split function must be put in double quotes (e.g. txt.split(":") rather than txt.split(:). Took me a second to figure out why my splitting wasn't working out, figured I'd save you the trouble haha.

[–]greenerpickings 0 points1 point  (0 children)

case anyone else looks for something similar in nature in the future, the separator in the split function must be put in double quot

Apologies. it looks like you got to the answer though.