BlinkenArea - GitList
Repositories
Blog
Wiki
stage_director
Code
Commits
Branches
Tags
Search
Tree:
8418363
Branches
Tags
master
stage_director
time_fmt.py
show current position as h:mm:ss.ss
Stefan Schuermans
commited
8418363
at 2013-11-14 21:38:33
time_fmt.py
Blame
History
Raw
#! /usr/bin/env python def sec2str(sec): sign = "" if sec < 0: sign = "-"; sec = -sec; sec1 = int(sec) sec100 = round((sec - sec1) * 100) minu = sec1 // 60 sec1 = sec1 % 60 hour = minu // 60 minu = minu % 60 return "%s%u:%02u:%02u.%02u" % (sign, hour, minu, sec1, sec100)