[
https://issues.apache.org/jira/browse/PHOENIX-3220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15448929#comment-15448929
]
Ankit Singhal commented on PHOENIX-3220:
----------------------------------------
Yes, it's a bug, as during TO_DATE evaluation , date literal is considered in
GMT(default) whereas DAYOFMONTH uses a local timezone.
As a workaround until we fix it , you can set phoenix.query.dateFormatTimeZone
in the client configuration equal to local timezone.(set explicitly , don't use
local keyward)
Note:- sqlline may not display date properly when you run TO_DATE after the
change(because formatter will still use GMT) but you can try using getDate()
api .
> DAYOFMONTH function not giving correct result for 24hr clock time format
> ------------------------------------------------------------------------
>
> Key: PHOENIX-3220
> URL: https://issues.apache.org/jira/browse/PHOENIX-3220
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.6.0
> Environment: CentOS
> Reporter: Neeru Jaroliya
>
> Query :
> 0: jdbc:phoenix:localhost> select DAYOFMONTH(TO_DATE('2016-04-01 23:45:00'));
> +------------+
> | 2 |
> +------------+
> | 2 |
> +------------+
> Expected Output : 1
> Issue : DAYOFMONTH function on 24hr clock time format increase the result by
> one.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)