Message107222
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. |
|
| Date |
User |
Action |
Args |
| 2010-06-06 20:18:01 | eric.smith | set | recipients:
+ eric.smith, brett.cannon, belopolsky, docs@python |
| 2010-06-06 20:18:01 | eric.smith | set | messageid: <[email protected]> |
| 2010-06-06 20:18:00 | eric.smith | link | issue8913 messages |
| 2010-06-06 20:18:00 | eric.smith | create | |
|