{"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":"python","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,"search_vec":"'2.4.1':31 'activ':40 'calendar':15,43 'convers':44 'convert':11 'convertd':1,4 'current':28 'date':12,42 'develop':41 'function':9 'gregorian':18,45 'hebrew':19,46 'holiday':51 'includ':17 'indic':39 'islam':20,47 'julian':21,48 'librari':2,5 'mani':24 'mayan':22,49 'method':7 'other':25 'per':37 'persian':50 'provid':6 'releas':36 'see':33 'system':16 'time':52 'various':14 'version':30 'year':38","created_at":"2026-04-09T05:06:21.226106+00:00","updated_at":"2026-04-16T03:46:34.136035+00:00","problems":[{"fix":"Install the `convertdate` library using pip: `pip install convertdate`","cause":"The `convertdate` library is not installed in your Python environment or the environment where you are running your code.","error":"ModuleNotFoundError: No module named 'convertdate'"},{"fix":"Upgrade `convertdate` to a newer version that supports the `pytz` version you have (or a more recent one), or try installing `convertdate` with a compatible `pytz` version if an older `convertdate` is strictly necessary. Often, updating `convertdate` resolves this: `pip install --upgrade convertdate`","cause":"This error occurs due to a dependency conflict where an older version of `convertdate` requires a `pytz` version older than what is currently installed or being installed.","error":"ERROR: convertdate 2.2.0 has requirement pytz<2020,>=2014.10, but you'll have pytz 2020.1 which is incompatible."},{"fix":"Ensure the format string passed to `strptime()` precisely matches the input date string. If the date components are invalid, correct the input date. For `convertdate`, ensure you pass valid integer year, month, and day components after successful parsing. Example: `from datetime import datetime; date_str = '2023-12-01'; dt_obj = datetime.strptime(date_str, '%Y-%m-%d'); from convertdate import gregorian; gregorian.to_jd(dt_obj.year, dt_obj.month, dt_obj.day)`","cause":"This error typically happens when you are trying to convert a date string to a datetime object using `datetime.strptime()`, but the format string provided does not exactly match the input date string's structure or the date components (like month 13) are invalid.","error":"ValueError: time data '2023-13-01' does not match format '%Y-%m-%d'"},{"fix":"You should either import `datetime` as `dt` and use `dt.datetime.strptime()`, or directly import the `datetime` class as `from datetime import datetime` and then use `datetime.strptime()`: `from datetime import datetime; date_object = datetime.strptime('2023-01-01', '%Y-%m-%d')`","cause":"This error occurs when you import the `datetime` module but then try to call `strptime()` directly on the module itself (`datetime.strptime`) instead of on the `datetime` class within the module (`datetime.datetime.strptime`).","error":"AttributeError: module 'datetime' has no attribute 'strptime'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.4.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/fitnr/convertdate","docs":null,"changelog":null,"pypi":"https://pypi.org/project/convertdate/","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-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":null}}