Skip to content

fix: use DAYS_PER_YEAR (365) for whole years in interval math#43

Open
adsharma wants to merge 1 commit into
mainfrom
fix/timestamp-interval-conversion
Open

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

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.
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