[Python-3000] __format__ and datetime

skip at pobox.com skip at pobox.com
Tue Sep 11 05:11:03 CEST 2007


    Paul> The date and time defaults (which appear to be %Y-%m-%d and
    Paul> %H:%M:%s) seem perfectly acceptable, on the other hand.

I would like to see an analog to %S which preserves fractions of a second as
the default formatting for time and datetime objects does:

    >>> print(now)
    2007-09-10 22:07:53.654774
    >>> print(now.strftime("%H:%M:%S"))
    22:07:53
    >>> print(now.time())
    22:07:53.654774

Skip


More information about the Python-3000 mailing list