fork download
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. import time
  5. from datetime import datetime
  6.  
  7. s_time = '2018-06-28T02:05:00+09:00'
  8. e_time = '2018-06-28T03:00:00+09:00'
  9.  
  10. ss_time = s_time[11:13] + '時' + s_time[14:16] + '分'
  11. ee_time = e_time[11:13] + '時' + e_time[14:16] + '分'
  12.  
  13. s_time_2 = time.strptime(s_time,'%Y-%m-%dT%H:%M:%S+09:00')
  14. e_time_2 = time.strptime(e_time,'%Y-%m-%dT%H:%M:%S+09:00')
  15.  
  16. epo_time_s = time.mktime(s_time_2)
  17. epo_time_e = time.mktime(e_time_2)
  18.  
  19. sabun = int((epo_time_e - epo_time_s) / 60)
  20.  
  21. # print(ss_time, '-', ee_time, '(', sabun, '分)')
  22. print(ss_time, '-', ee_time + '(', sabun + '分)')
  23.  
Runtime error #stdin #stdout #stderr 0.05s 10508KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 22, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'