Advertisement
DeaD_EyE

seconds to hour, minute, seconds, miliseconds

Jun 9th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def to_hmsms(seconds):
  2.     """
  3.    Returns hours, minutes, seconds, miliseconds as int
  4.    """
  5.     minutes, seconds = divmod(seconds, 60)
  6.     hours, minutes = divmod(minutes, 60)
  7.     return int(hours), int(minutes), round(seconds), round((seconds - int(seconds))*1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement