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:26r.david.murraysetrecipients: + r.david.murray, belopolsky, wwycheuk
2012-03-29 15:23:26r.david.murraysetmessageid: <1333034606.2.0.110274152516.issue14441@psf.upfronthosting.co.za>
2012-03-29 15:23:25r.david.murraylinkissue14441 messages
2012-03-29 15:23:25r.david.murraycreate