def strftime_pre_1900(self, dt, fmt=None):
    "Call time.strftime for years before 1900 by rolling\n        forward a multiple of 28 years.\n\n        *fmt* is a :func:`strftime` format string.\n\n        Dalke: I hope I did this math right.  Every 28 years the\n        calendar repeats, except through century leap years excepting\n        the 400 year leap years.  But only if you're using the Gregorian\n        calendar.\n        "
    if (fmt is None):
        fmt = self.fmt
    fmt = re.sub('((^|[^%])(%%)*)%f', '\\g<1>{0:06d}'.format(dt.microsecond), fmt)
    year = dt.year
    delta = (2000 - year)
    off = (6 * ((delta // 100) + (delta // 400)))
    year = (year + off)
    year1 = (year + (((2000 - year) // 28) * 28))
    year2 = (year1 + 28)
    timetuple = dt.timetuple()
    s1 = time.strftime(fmt, ((year1,) + timetuple[1:]))
    s2 = time.strftime(fmt, ((year2,) + timetuple[1:]))
    (s1, s2) = self._replace_common_substr(s1, s2, '{0:04d}'.format(year1), '{0:04d}'.format(year2), '{0:04d}'.format(dt.year))
    (s1, s2) = self._replace_common_substr(s1, s2, '{0:02d}'.format((year1 % 100)), '{0:02d}'.format((year2 % 100)), '{0:02d}'.format((dt.year % 100)))
    return cbook.unicode_safe(s1)
Call time.strftime for years before 1900 by rolling
forward a multiple of 28 years.

*fmt* is a :func:`strftime` format string.

Dalke: I hope I did this math right.  Every 28 years the
calendar repeats, except through century leap years excepting
the 400 year leap years.  But only if you're using the Gregorian
calendar.
def strftime_pre_1900(self, dt, fmt=None):
    "Call time.strftime for years before 1900 by rolling\n        forward a multiple of 28 years.\n\n        *fmt* is a :func:`strftime` format string.\n\n        Dalke: I hope I did this math right.  Every 28 years the\n        calendar repeats, except through century leap years excepting\n        the 400 year leap years.  But only if you're using the Gregorian\n        calendar.\n        "
    if (fmt is None):
        fmt = self.fmt
    fmt = re.sub('((^|[^%])(%%)*)%f', '\\g<1>{0:06d}'.format(dt.microsecond), fmt)
    year = dt.year
    delta = (2000 - year)
    off = (6 * ((delta // 100) + (delta // 400)))
    year = (year + off)
    year1 = (year + (((2000 - year) // 28) * 28))
    year2 = (year1 + 28)
    timetuple = dt.timetuple()
    s1 = time.strftime(fmt, ((year1,) + timetuple[1:]))
    s2 = time.strftime(fmt, ((year2,) + timetuple[1:]))
    (s1, s2) = self._replace_common_substr(s1, s2, '{0:04d}'.format(year1), '{0:04d}'.format(year2), '{0:04d}'.format(dt.year))
    (s1, s2) = self._replace_common_substr(s1, s2, '{0:02d}'.format((year1 % 100)), '{0:02d}'.format((year2 % 100)), '{0:02d}'.format((dt.year % 100)))
    return cbook.unicode_safe(s1)