Seconds to hour:minute:seconds :ptype seconds: float :rtype: str https://stackoverflow.com/questions/775049/how-do-i-convert-seconds-to-hours-minutes-and-seconds
(seconds)
| 934 | |
| 935 | @staticmethod |
| 936 | def seconds_to_hms(seconds): |
| 937 | ''' |
| 938 | Seconds to hour:minute:seconds |
| 939 | |
| 940 | :ptype seconds: float |
| 941 | :rtype: str |
| 942 | |
| 943 | https://stackoverflow.com/questions/775049/how-do-i-convert-seconds-to-hours-minutes-and-seconds |
| 944 | ''' |
| 945 | frac, whole = math.modf(seconds) |
| 946 | hours, rem = divmod(whole, 3600) |
| 947 | minutes, seconds = divmod(rem, 60) |
| 948 | return '{:02}:{:02}:{:02}'.format(int(hours), int(minutes), int(seconds)) |
| 949 | |
| 950 | def print_time(self, ellapsed_seconds): |
| 951 | if self.env['print_time'] and not self.env['quiet']: |
no outgoing calls
no test coverage detected