[ https://issues.apache.org/jira/browse/CALCITE-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494261#comment-16494261 ]
ASF GitHub Bot commented on CALCITE-1884: ----------------------------------------- GitHub user snuyanzin opened a pull request: https://github.com/apache/calcite-avatica/pull/52 CALCITE-1884 DateTimeUtils produces incorrect results for days before Gregorian cutovers 1. remove convertation to Gregorian in case of org.apache.calcite.avatica.util.DateTimeUtils#ymdToJulian 2. added tests 3. corrected tests for CENTURY and MILLENNIUM as a side effect You can merge this pull request into a Git repository by running: $ git pull https://github.com/snuyanzin/calcite-avatica CALCITE_1884 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/calcite-avatica/pull/52.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 #52 ---- commit 9943d1971cbfbb8a3dbaa843cf0e6d2ae8aad3b4 Author: snuyanzin <snuyanzin@...> Date: 2018-05-29T15:08:05Z 1) remove convertation to Gregorian in case of org.apache.calcite.avatica.util.DateTimeUtils#ymdToJulian 2) added tests ---- > 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 > Priority: Major > Fix For: avatica-1.12.0 > > > 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 (v7.6.3#76005)