Python HackerRank|Time Delta(from datetime import datetime)

  1. Dashboard 
  2.  Python 
  3.  Date and Time 
  4.  Time Delta
    1. from datetime import datetime
      
      fmt = '%a %d %b %Y %H:%M:%S %z'
      for _ in range(int(input())):
          t1 = datetime.strptime(input(), fmt)
          t2 = datetime.strptime(input(), fmt)
          print(abs(int((t1 - t2).total_seconds())))


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章