Is there a format for printing Python datetimes that won't use zero-padding on dates and times?
Format I'm using now:
The formatting options available with
datetime.strftime() will all zero-pad. You could of course roll you own formatting function, but the easiest solution in this case might be to post-process the result of
s = mydatetime.strftime('%m/%d/%Y %I:%M%p').lstrip("0").replace(" 0", " ")
(That is, if you decide that doing so is really worth the trouble. Why not simply leave the zeros in?)