Message157058
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' |
|
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 | |
|