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

Istvan Toth commented on PHOENIX-6949:
--------------------------------------

Another question is how to use the passed Calendar when the calendar is passed.
We can either just take the timezone from it, and use it directly, or we can 
use Calendar's API for calculating the offset.

Using the Calendar's API requires modifying it, which causes thread safety 
issues. (Sharing Calendar objects between threads is not a good idea, somone 
somewhere is guaranteed to have code that does exactly that)

> Use j.u.Date.getTimeOffset() for displacement calculation
> ---------------------------------------------------------
>
>                 Key: PHOENIX-6949
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6949
>             Project: Phoenix
>          Issue Type: Bug
>          Components: core
>            Reporter: Istvan Toth
>            Priority: Major
>
> The current code calculates the offset from the current timezone.
> However, java.util.Date and its children (java.sql.Date*) already provide the 
> getTimeOffset()  for the same.
> -This has the added benefit that in the unlikely case that we receive the a 
> java.sql.Date that is not in the JVM timezone, then we use its offset 
> correctly.-



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to