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

Ramesh Reddy edited comment on OLINGO-864 at 2/10/16 7:19 PM:
--------------------------------------------------------------

[~chrisam] I updated the patch to remove the system property. Now it will only 
depend upon the JVM's default timezone for the Date and Time handling. So, we 
do not even need to provide any configuration, as if the service developer 
changes the default timezone of the JVM, Olingo will work with those settings. 
Certain unit tests with Date & Time handling are set to assume GMT for the 
predictable string based comparison of their results.

https://github.com/apache/olingo-odata4/commit/7b26cc6ee7515b4f2657fe9756862882ead7f26d

Let me know if you are OK with these changes and I will merge into master.


was (Author: rareddy):
[~chrisam] I updated the patch to remove the system property. Now it will only 
depend upon the JVM's default timezone for the Date and Time handling. So, we 
do not even need to provide any configuration, as if the service developer 
changes the default timezone of the JVM, Olingo will work with those settings. 
Certain unit tests with Date & Time handling are set to assume GMT for the 
predictable string based comparison of their results.


Let me know if you are OK with these changes and I will merge into master.

> EdmDate and EdmTimeOfDay output in local timezone
> -------------------------------------------------
>
>                 Key: OLINGO-864
>                 URL: https://issues.apache.org/jira/browse/OLINGO-864
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-commons
>    Affects Versions: (Java) V4 4.0.0-beta-01
>            Reporter: Ramesh Reddy
>            Assignee: Ramesh Reddy
>            Priority: Critical
>             Fix For: (Java) V4 4.2.0
>
>
> EdmDate and EdmTimeOfDay both assume GMT for incoming string values - however 
> when the convert from Java objects to string they use the local/default 
> Calendar. 
> OData TC says  parsing Date or Time should be exactly same in every time zone.
> This highlights the issue with EdmDate:
> TimeZone.setDefault(TimeZone.getTimeZone("GMT-1"));
> java.sql.Timestamp date = EdmDate.getInstance().valueOfString("2000-01-01", 
> true, 4000, 0, 0, true, java.sql.Timestamp.class);
> assertEquals("1999-12-31 23:00:00.0", date.toString());
> String val = EdmDate.getInstance().valueToString(date, true, 4000, 0, 0, 
> true);
> assertEquals("2000-01-01", date.toString());
> The last line fails because the date will be "1999-12-31" instead.
> Linked issue at https://issues.jboss.org/browse/TEIID-3938



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to