See ~L350 in `matplotlib.dates.py` in `strftime`. Without delving too deep, I think this should be handled by `datetime`.