If I use a Matplotlib DateFormatter, like this:
mydateformatter = DateFormatter("%b %d %I:%M %p", self._tz)
I’ll get dates like (note the time part has a leading zero):
Nov 27 2011
03:00 PM
Instead, I’d like to lose the leading zero on times (more human that way), like:
Nov 27 2011
3:00 PM
Is there a way to do that?
Note: see the edit history to understand the discussion in the comments below. This post has been rewritten to reflect them.
It can’t be done using the standard date conversion specifiers, which are listed in the python docs (the same ones as standardized by C). However, there may be platform dependent ways to accomplish this format. A bit of code like this might come in handy:
I have confirmed
%lto work on Linux and the OP has confirmed ‘%#I` to work on Windows.