Advertisement
greedydev

Untitled

Oct 18th, 2022
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import datetime
  2.    
  3. if __name__ == '__main__':
  4.     first = list(map(int, input().split(":")))
  5.     second = list(map(int, input().split(":")))
  6.  
  7.     first_timestamp = datetime.timedelta(hours=first[0], minutes=first[1])
  8.     second_timestamp = datetime.timedelta(hours=second[0], minutes=second[1])
  9.  
  10.     res = (first_timestamp + second_timestamp).total_seconds() % (24 * 60 * 60)
  11.  
  12.  
  13.     print(f"{int(res / 60 / 60):02}:{int((res % (60*60)) / 60):02}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement