Advertisement
Transfusion

Python get seconds from min:sec

May 24th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1.  
  2. def getseconds(time):
  3. splittime = time.split(':')
  4. return int(splittime[0])*60+int(splittime[1])
  5.  
  6. #seconds = minutes*60.
  7.  
  8. print getseconds('10:15')
  9. print getseconds('12:00')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement