[ 
https://issues.apache.org/jira/browse/CALCITE-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095573#comment-16095573
 ] 

Julian Hyde commented on CALCITE-1884:
--------------------------------------

What does Date.toString() print for the day before 1752-09-14? Are you seeing 
it print 1752-09-02? If so, then it's shifted into old-style. But it's still 
the day before 1752-09-14, its julian day number is one smaller, and frankly 
it's just a problem with how java prints it.

SQL, which stays in new style, would print 1752-09-13.

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

Reply via email to