[ 
https://issues.apache.org/jira/browse/XMLBEANS-588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

PJ Fanning updated XMLBEANS-588:
--------------------------------
    Fix Version/s: Version 5.1.0

> GDate can return diferent values on different current timezones
> ---------------------------------------------------------------
>
>                 Key: XMLBEANS-588
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-588
>             Project: XMLBeans
>          Issue Type: Bug
>            Reporter: Robert Marcano
>            Priority: Major
>             Fix For: Version 5.1.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> When using Saxon XPath processor in order to retrieve a date value for 
> example:
> {{XmlObject o = XmlObject.Factory.parse("<a/>");}}
> {{XmlObject[] res = o.selectPath("xs:date(\"2000-01-01\")");}}
> {{GDate gdate = ((XmlDate) res[0]).getGDateValue();}}
> {{assertEquals(gdate.getYear(), 2000);}}
> fails is the current timezone has a negative offset, for example US/Eastern.
> The problem arises because _SaxonXPath_ uses internally a method that returns 
> _java.util.Date_ instances and those always has a timezone attached. Maybe 
> the _GDate_ should not come from a Date resulting from the invocation of 
> _SequenceTool.convertToJava()_ in _SaxonXPath_ 
> {{GDate}} should contain the exact date without timezone problems, it could 
> probably should not be instantiated from a _Date_ coming from Saxon, but from 
> the native Saxon _Date_ representation



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to