.zfill(3) milliseconds in utils.datetime.datetime_human
This commit is contained in:
parent
cb73507c5e
commit
dba3f7abc3
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ def datetime_human(dt: _datetime.datetime, timespec: TimeSpec=TimeSpec.NORMAL):
|
|||
date = _datetime.datetime.strftime(dt, DATE_HUMAN)
|
||||
time = _datetime.datetime.strftime(dt, TIME_HUMAN)
|
||||
if timespec == TimeSpec.MILLISECOND:
|
||||
time += ".%s" % int(dt.microsecond/1000)
|
||||
time += ".%s" % str(int(dt.microsecond/1000)).zfill(3)
|
||||
return "%s %s" % (date, time)
|
||||
def date_human(dt: _datetime.datetime, timespec: TimeSpec=TimeSpec.NORMAL):
|
||||
return _datetime.datetime.strftime(dt, DATE_HUMAN)
|
||||
|
|
Loading…
Reference in a new issue