{"id":2546,"library":"jdcal","title":"Julian Dates from Proleptic Gregorian and Julian Calendars","description":"jdcal is a Python module designed for converting between Julian dates and calendar dates, supporting both proleptic Gregorian and Julian calendars. It enhances precision by storing Julian dates as a pair of floating-point numbers. The library provides functions for conversions in both directions (e.g., `gcal2jd` for Gregorian to Julian Date, and `jd2gcal` for the reverse). The current version is 1.4.1, with its last update in April 2019, suggesting a maintenance-focused release cadence.","status":"maintenance","version":"1.4.1","language":"en","source_language":"en","source_url":"https://github.com/phn/jdcal","tags":["astronomy","calendar","date","time","julian date","gregorian date"],"install":[{"cmd":"pip install jdcal","lang":"bash","label":"Install jdcal"}],"dependencies":[],"imports":[{"symbol":"gcal2jd","correct":"from jdcal import gcal2jd"},{"symbol":"jd2gcal","correct":"from jdcal import jd2gcal"},{"symbol":"jcal2jd","correct":"from jdcal import jcal2jd"},{"symbol":"jd2jcal","correct":"from jdcal import jd2jcal"}],"quickstart":{"code":"from jdcal import gcal2jd, jd2gcal\n\n# Convert Gregorian date to Julian date\nyear, month, day = 2000, 1, 1\njd1, jd2 = gcal2jd(year, month, day)\nprint(f\"Gregorian {year}-{month}-{day} is Julian Date: {jd1} + {jd2} = {jd1 + jd2}\")\n\n# Convert Julian date back to Gregorian date\ng_year, g_month, g_day, g_fraction = jd2gcal(jd1, jd2)\nprint(f\"Julian Date {jd1} + {jd2} converts to Gregorian: {g_year}-{g_month}-{g_day} (fraction: {g_fraction})\")","lang":"python","description":"This example demonstrates how to convert a Gregorian date to a Julian date using `gcal2jd` and then convert it back to a Gregorian date using `jd2gcal`."},"warnings":[{"fix":"Always pass and receive Julian dates as a tuple of two floats. For the full Julian date, sum `jd1 + jd2`.","message":"Julian dates are returned and expected as two separate floating-point numbers (jd1, jd2) to maintain maximum precision. Always handle both components for calculations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware that conversions for dates far in the past apply modern calendar rules. For historical accuracy, external logic might be needed to determine the correct calendar system for a given date.","message":"The library uses 'proleptic' calendars, meaning Gregorian and Julian calendar rules are applied to dates even before their historical adoption. This may not align with historical calendar usage in specific regions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Avoid installing version 1.0 directly. Use the latest stable version (`pip install jdcal`) or a version greater than 1.0.","message":"Installation of `jdcal==1.0` via `pip` was problematic due to a missing `LICENSE.txt` file in the PyPI tarball, leading to installation failures.","severity":"breaking","affected_versions":"1.0"},{"fix":"Ensure `jdcal` is installed before `openpyxl` if using older versions of `openpyxl` that explicitly relied on it, or upgrade `openpyxl` to a newer version where this is less of an issue. `jdcal` itself does not have a dependency on `openpyxl`.","message":"Older versions of `openpyxl` (a dependency of `jdcal` for some users, but not a direct dependency *of* `jdcal`) had integration issues leading to `ImportError` if `jdcal` was not installed or if installation order was incorrect.","severity":"gotcha","affected_versions":"< 2.5 of `openpyxl` (and implicitly `jdcal` when used with it)"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}