Skip to content

fix: use DAYS_PER_YEAR (365) for whole years in interval-to-timedelta conversion - #46

Closed
adsharma wants to merge 1 commit into
mainfrom
fix/timestamp-tz2
Closed

fix: use DAYS_PER_YEAR (365) for whole years in interval-to-timedelta conversion#46
adsharma wants to merge 1 commit into
mainfrom
fix/timestamp-tz2

Conversation

@adsharma

Copy link
Copy Markdown
Contributor

Fixes: LadybugDB/ladybug#694

PyQueryResult::convertValueToPyObject (pybind path) and all interval conversion sites in _lbug_capi.py (C-API path) now use
days = years * 365 + months * 30 + days
instead of
days = months * 30 + days

This gives 365 days per whole year instead of 360, matching the engine's Interval::DAYS_PER_YEAR constant.

… conversion

PyQueryResult::convertValueToPyObject (pybind path) and all interval
conversion sites in _lbug_capi.py (C-API path) now use
  days = years * 365 + months * 30 + days
instead of
  days = months * 30 + days

This gives 365 days per whole year instead of 360, matching the
engine's Interval::DAYS_PER_YEAR constant.
@adsharma

Copy link
Copy Markdown
Contributor Author

Handled in #47

@adsharma adsharma closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Timestamp and Interval (date) datatypes are not intuitively correct!?

1 participant