Message157058
| Author |
r.david.murray |
| Recipients |
belopolsky, r.david.murray, wwycheuk |
| Date |
2012年03月29日.15:23:25 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1333034606.2.0.110274152516.issue14441@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It turns out that there is standard way to do this (well, a de-facto standard, anyway). glibc (and apparently others) support 'modifiers', of which the '-' modifier will suppress 0 padding. Furthermore, since we pass the format string through to glibc, Python *already* supports this on glibc based platforms, though it isn't documented:
>>> t.strftime("%m")
'03'
>>> t.strftime("%-m")
'3' |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年03月29日 15:23:26 | r.david.murray | set | recipients:
+ r.david.murray, belopolsky, wwycheuk |
| 2012年03月29日 15:23:26 | r.david.murray | set | messageid: <1333034606.2.0.110274152516.issue14441@psf.upfronthosting.co.za> |
| 2012年03月29日 15:23:25 | r.david.murray | link | issue14441 messages |
| 2012年03月29日 15:23:25 | r.david.murray | create |
|