[
https://issues.apache.org/jira/browse/CALCITE-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093780#comment-16093780
]
ASF GitHub Bot commented on CALCITE-1884:
-----------------------------------------
GitHub user haohui opened a pull request:
https://github.com/apache/calcite-avatica/pull/11
[CALCITE-1884] DateTimeUtils produces incorrect results for days before the
Gregorian cutovers
This PR augments the supports of Julian days that are before the Gregorian
cutovers in DateTimeUtils.
It implements the algorithm from the book "Astronomical Algorithms" by Jean
Meeus, 1998.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/haohui/calcite-avatica CALCITE-1884
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/calcite-avatica/pull/11.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11
----
commit a62c3108eb4cb1474c8540104744c44e34ccf66d
Author: Haohui Mai <[email protected]>
Date: 2017-07-19T20:51:51Z
[CALCITE-1884] DateTimeUtils produces incorrect results for days before
Gregorian cutovers.
----
> DateTimeUtils produces incorrect results for days before Gregorian cutovers
> ---------------------------------------------------------------------------
>
> Key: CALCITE-1884
> URL: https://issues.apache.org/jira/browse/CALCITE-1884
> Project: Calcite
> Issue Type: Bug
> Components: avatica
> Affects Versions: 1.13.0
> Reporter: Haohui Mai
> Assignee: Haohui Mai
>
> dateStringToUnixDate() / unixDateToString() do not return consistent result.
> The following test fails:
> {noformat}
> @Test public void testUnixDate() {
> int days = DateTimeUtils.dateStringToUnixDate("1500-04-30");
> assertEquals("1500-04-30", DateTimeUtils.unixDateToString(days));
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)