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

John Cheng commented on XALANJ-2536:
------------------------------------

The following code should properly handle the formatting of the minute 
component.


$ svn diff src/org/apache/xalan/lib/ExsltDatetime.java 
Index: src/org/apache/xalan/lib/ExsltDatetime.java
===================================================================
--- src/org/apache/xalan/lib/ExsltDatetime.java (revision 1095479)
+++ src/org/apache/xalan/lib/ExsltDatetime.java (working copy)
@@ -94,6 +94,9 @@
         int hrs = offset/(60*60*1000);
         // In a few cases, the time zone may be +/-hh:30.
         int min = offset%(60*60*1000);
+        if ( min != 0 ) {
+            min = min/(60*1000);
+        }
         char posneg = hrs < 0? '-': '+';
         buff.append(posneg + formatDigits(hrs) + ':' + formatDigits(min));
       }


> The ExsltDatetime.dateTime() function does not work in a timezone like India 
> Standard Time (GMT+5:30)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: XALANJ-2536
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2536
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in 
> Xalan projects.  Anybody can view the issue.) 
>          Components: Xalan-extensions
>    Affects Versions: 2.7.1
>         Environment: This problem occurs when the time zone offset has a 
> non-zero minute component for example, IST uses GMT+5:30.
>            Reporter: John Cheng
>              Labels: datetime, exslt, timezone
>         Attachments: TestExsltDatetimeOffset.java
>
>
> When the default time zone offset has a non-zero minute component, this bug 
> causes the date-time() to return a string that is not a valid xsd:dateTime.
> For example, when the default time zone is IST, then the format looks like:
> 2011-04-19T22:08:16+05:1800000 
> It is expected to be
> 2011-04-19T22:08:16+05:30

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to