[docs] [issue8913] Document that datetime.__format__ is datetime.strftime

Eric Smith report at bugs.python.org
Sun Jun 6 22:18:02 CEST 2010


Eric Smith <eric at trueblade.com> added the comment:

I think Alexander's example is best written as:
"Today is: {0:%a %b %d %H:%M:%S %Y}".format(datetime.now())

I agree with Brett that there's nothing unusual about having type-specific formatting languages, and for datetime strftime is the obvious choice. It's a little unfortunate that % is used, as it's mildly confusing with %-formatting, but not much can be done with that issue.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8913>
_______________________________________


More information about the docs mailing list