It accepts all the keywords defined in the RFC as its constructor parameters (except byday, which was renamed to byweekday) and more.The constructor prototype is: relativedelta(arg1=x,arg2=y,arg3=z...) year, month, day, hour, minute, second, microsecond: Absolute information (argument is singular); adding or subtracting a relativedelta with absolute information does not perform an aritmetic operation, but rather REPLACES the corresponding value in the original datetime with the value(s) in relativedelta.
This practice is not universal, and calendar differences can cause confusing differences between what Python and mpl give as the number of days since 0001-01-01 and what other software and databases yield.
For example, the US Naval Observatory uses a calendar that switches from Julian to Gregorian in October, 1582.
Hence, using their calculator, the number of days between 0001-01--04-01 is 732403, whereas using the Gregorian calendar via the datetime module we find: for general information on tick locators and formatters. All the matplotlib date converters, tickers and formatters are timezone aware, and the default timezone is given by the timezone parameter in your instance or a sequence of datetimes.
Return value is a floating point number (or sequence of floats) which gives the number of days (fraction part represents hours, minutes, seconds) since 0001-01-01 UTC, format string.
Warning: For years before 1900, depending upon the current locale it is possible that the year displayed with %x might be incorrect. Every 28 years the calendar repeats, except through century leap years excepting the 400 year leap years. is the maximum number of ticks desired, which controls any interval between ticks (ticking every other, every 3, etc.).
For years before 100, %y and %Y will yield zero-padded strings. For really fine-grained control, this can be a dictionary mapping individual rrule frequency constants (YEARLY, MONTHLY, etc.) to their own maximum number of ticks.This can be used to keep the number of ticks appropriate to the format chosen in is a boolean that indicates whether ticks should be chosen to be multiple of the interval. For example, this will force the ticks to be at hours 0,6,12,18 when hourly ticking is done at 6 hour intervals.The Auto Date Locator has an interval dictionary that maps the frequency of the tick (a constant from dateutil.rrule) and a multiple allowed for that ticking.The default looks like this: The interval is used to specify multiples that are appropriate for the frequency of ticking.For instance, every 7 days is sensible for daily ticks, but for minutes/seconds, 15 or 30 make sense.You can customize this dictionary by doing: That’s the base of the rrule operation.