Next in thread → Next in month →

Re: [xml-dev] is there a java utility class that can convert between a XML Sche ma dateTime formated string and a java.util.Date or java.sql.TimeStamp

From
Dennis Sosnoski <>
To
Bill Riegel <>
Date
2003-05-22T17:36:08Z
ID
<>
Thread
Re: [xml-dev] is there a java utility class that can convert between a XML Sche ma dateTime formated string and a java.util.Date or java.sql.TimeStamp
I think there may be some problems trying to do this using the standard 
Java libraries (as one obscure example, I don't think the standard 
libraries support the proleptic Gregorian calendar used by WXS, so they 
would not work properly for dates more than a few centuries back), but 
you can lift code from my JiBX project at http://www.jibx.org for this 
purpose. The org.jibx.runtime.Utility class has full support for 
converting the Schema date formats to and from Java java.util.Dates. I 
suspect it's also much faster than the equivalent using the standard 
Java libraries.

Source is in the download, or you can get this class from CVS directly 
at 
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jibx/jibx/build/src/org/jibx/runtime/Utility.java 
The methods for converting dateTime values are serializeDateTime and 
deserializeDateTime.

 - Dennis


Bill Riegel wrote:

>Bill Riegel
>LandMark Graphics
>713-839-3388
>
>
>
>-----------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To subscribe or unsubscribe from this list use the subscription
>manager: <http://lists.xml.org/ob/adm.pl>
>
>  
>
Next in thread → Next in month →