{"id":23517,"library":"datedelta","title":"datedelta","description":"Provides a DateDelta class for arithmetic between dates, similar to datetime.timedelta but for date objects. Current version 1.4, release cadence is low (last release 2019).","status":"active","version":"1.4","language":"python","source_language":"en","source_url":"https://github.com/aaugustin/datedelta","tags":["date","arithmetic","delta","calendar"],"install":[{"cmd":"pip install datedelta","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"wrong":"from datedelta import DateDelta","symbol":"datedelta","correct":"from datedelta import datedelta"}],"quickstart":{"code":"from datetime import date\nfrom datedelta import DateDelta, DAYS, MONTHS, YEARS\n\ntoday = date.today()\ndelta = DateDelta(years=1, months=2, days=10)\nnew_date = today + delta\nprint(new_date)\n\n# Or using constants:\nnew_date2 = today + 1*YEARS + 2*MONTHS + 10*DAYS\nprint(new_date2)","lang":"python","description":"Add a DateDelta to a date to get another date."},"warnings":[{"fix":"Convert datetime to date first: some_datetime.date() + datedelta","message":"DateDelta cannot be added to datetime objects, only date objects. Attempting to add to datetime causes a TypeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Be aware of month-end clamping behavior; it's by design.","message":"Adding a DateDelta with months to a date near month end can produce unexpected results (e.g., Jan 31 + 1 month = Feb 28/29). No month overflow to next month.","severity":"gotcha","affected_versions":"all"},{"fix":"Use datetime.timedelta for sub-day precision.","message":"DateDelta only supports years, months, weeks, days. No support for hours, minutes, seconds, or microseconds.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.4':19 '2019':26 'arithmet':7,28 'cadenc':21 'calendar':30 'class':5 'current':17 'date':9,15,27 'datedelta':1,4 'datetime.timedelta':12 'delta':29 'last':24 'low':23 'object':16 'provid':2 'releas':20,25 'similar':10 'version':18","created_at":"2026-05-01T08:08:11.678767+00:00","updated_at":"2026-05-01T08:08:11.678767+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/aaugustin/datedelta","docs":null,"changelog":null,"pypi":"https://pypi.org/project/datedelta/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}