We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I use dateutil.parser in Pycharm, it works. But Hackerrank doesn't support dateutil.parser. So the easiest way is to do the following, even it won't have you pass Hackerrank's test cases. You can try it in your own IDE.
from dateutil import parser
for _ in range(int(input())):
d1 = parser.parse(input().strip())
d2 = parser.parse(input().strip())
print(abs(int((d2-d1).total_seconds())))
Time Delta
You are viewing a single comment's thread. Return to all comments →
I use dateutil.parser in Pycharm, it works. But Hackerrank doesn't support dateutil.parser. So the easiest way is to do the following, even it won't have you pass Hackerrank's test cases. You can try it in your own IDE.