thdl.utils.common
¶
-
thdl.utils.common.
now
()[source]¶ Get the format time of NOW.
For example:
>>> now() >>> "2017-04-26-16-44-56"
Returns: str
instance.
-
thdl.utils.common.
today
()[source]¶ Get the format time of TODAY.
For example:
>>> today() >>> "2017-04-26"
Returns: str
instance.
-
thdl.utils.common.
time_format
(total_time)[source]¶ Change the total time into the normal time format.
For examples:
>>> time_format(36) >>> "36 s" >>> time_format(90) >>> "1 min 30 s " >>> time_format(5420) >>> "1 h 30 min 20 s" >>> time_format(20.5) >>> "20 s 500 ms"
Parameters: total_time – float
orstr
instance. The total seconds of the time.Returns: str
instance. The format string about time.