mirror of https://github.com/testerSunshine/12306
15 lines
290 B
Python
15 lines
290 B
Python
![]() |
def time_to_minutes(time_str):
|
||
|
s = time_str.split(":")
|
||
|
a = int(s[0]) * 60 + int(s[1])
|
||
|
return a
|
||
|
|
||
|
|
||
|
def minutes_to_time(minutes):
|
||
|
m = minutes % 60
|
||
|
if m<10:
|
||
|
return str(minutes / 60) + ":" + str("0"+str(m))
|
||
|
else:
|
||
|
return str(minutes / 60) + ":" + str(m)
|
||
|
|
||
|
|