Open jmpark0118 opened 3 years ago
from datetime import datetime
def time_delta(t1, t2):
time1 = datetime.strptime(t1, '%a %d %b %Y %H:%M:%S %z')
time2 = datetime.strptime(t2, '%a %d %b %Y %H:%M:%S %z')
return time1-time2
if __name__ == '__main__':
t = int(input())
for t_itr in range(t):
t1 = input()
t2 = input()
delta = time_delta(t1, t2)
print(int(abs(delta.total_seconds())))
출처 : https://www.hackerrank.com/challenges/python-time-delta/problem