{"id":1813,"library":"convertdate","title":"Convertdate Library","description":"The `convertdate` library provides methods and functions for converting dates between various calendar systems, including Gregorian, Hebrew, Islamic, Julian, Mayan, and many others. It is currently at version 2.4.1 and sees a few releases per year, indicating active development.","status":"active","version":"2.4.1","language":"en","source_language":"en","source_url":"https://github.com/fitnr/convertdate","tags":["date","calendar","conversion","gregorian","hebrew","islamic","julian","mayan","persian","holidays","time"],"install":[{"cmd":"pip install convertdate","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"french_republican","correct":"from convertdate import french_republican"},{"symbol":"hebrew","correct":"from convertdate import hebrew"},{"symbol":"julian","correct":"from convertdate import julian"},{"note":"For calculating holidays in various systems.","symbol":"holidays","correct":"from convertdate import holidays"}],"quickstart":{"code":"from convertdate import french_republican\nfrom convertdate import hebrew\nfrom convertdate import julian\n\n# Convert Gregorian date to French Republican\nfr_date = french_republican.from_gregorian(2014, 10, 31)\nprint(f\"Gregorian 2014-10-31 in French Republican: {fr_date}\")\n\n# Convert Gregorian date to Hebrew\nhe_date = hebrew.from_gregorian(2014, 10, 31)\nprint(f\"Gregorian 2014-10-31 in Hebrew: {he_date}\")\n\n# Generate a Julian month calendar for January 2015\njulian_month_calendar = julian.monthcalendar(2015, 1)\nprint(f\"Julian calendar for Jan 2015: {julian_month_calendar}\")","lang":"python","description":"Demonstrates converting Gregorian dates to French Republican and Hebrew calendars, and generating a Julian month calendar."},"warnings":[{"fix":"Upgrade your Python interpreter to version 3.7 or higher.","message":"Python 3.5 and 3.6 are no longer supported. Ensure your environment uses Python 3.7 or newer.","severity":"breaking","affected_versions":">=2.4.0"},{"fix":"Review any code that might interact with `convertdate`'s internal timezone handling or if you pass `pytz` objects directly, and adapt to use `datetime.timezone.utc` where appropriate.","message":"Timezone handling internally switched from `pytz.utc` to `datetime.timezone.utc`. While direct `pytz` interaction might not be common, be aware of this change if you were relying on specific `pytz` behaviors or objects interacting with `convertdate`.","severity":"breaking","affected_versions":">=2.4.0"},{"fix":"Verify calculations for Persian dates after upgrading, especially for historical or sensitive applications.","message":"The Persian calendar computation method changed from an algorithmic to an astronomical one. This might lead to different results for dates compared to previous versions.","severity":"breaking","affected_versions":">=2.3.2"},{"fix":"Ensure that inputs for Mayan calendar conversions are within the valid epoch or handle `ValueError` exceptions.","message":"Attempting to convert dates before the Mayan epoch will now raise a `ValueError` instead of potentially returning incorrect or undefined results.","severity":"breaking","affected_versions":">=2.3.2"},{"fix":"Update your code to use the new variable names as specified in the changelog (e.g., `coptic.MONTHS` instead of `coptic.MONTH_NAMES`).","message":"Several calendar modules had their variable names regularized (e.g., `coptic.MONTH_NAMES` was renamed to `coptic.MONTHS`). Code accessing the old variable names will no longer function.","severity":"breaking","affected_versions":">=2.3.0"},{"fix":"Review and update any logic handling pre-Common Era Julian dates to align with the astronomical notation.","message":"The Julian converter now uses astronomical notation for pre-Common Era dates (1 BCE is 0, 2 BCE is -1). This is a fundamental change in date representation for these periods.","severity":"breaking","affected_versions":">=2.0.3"},{"fix":"Account for the 'noon-of-the-day' convention if your application requires precision for dates that begin at sundown in certain calendar systems.","message":"Date conversions return results for noon of the day in question. Be aware that some calendar systems begin the day at sundown, which might require an adjustment in your application logic.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}