[issue13882] Add format argument for time.time(), time.clock(), ... to get a timestamp as a Decimal object
STINNER Victor
report at bugs.python.org
Mon Jan 30 23:27:45 CET 2012
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
Version 5:
- add "datetime" and "timespec" formats: datetime.datetime object and (sec: int, nsec: int)
- add timestamp optional format to os.stat(), os.lstat(), os.fstat(), os.fstatat()
- support passing the timestamp format as a keyword: time.time(format="decimal")
I am not really conviced by the usefulness of "timespec" format, but it was just an example for #11457.
The "datetime" format is surprising for time.clock() and time.wallclock(), these timestamps use an arbitrary start. I suppose that time.clock(format="datetime") and time.wallclock(format="datetime") should raise a ValueError.
----------
Added file: http://bugs.python.org/file24372/time_decimal-5.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13882>
_______________________________________
More information about the Python-bugs-list
mailing list