Re: Fw: How to date type conversion between xml and Java

Tatu Saloranta <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
--- On Sun, 8/15/10, Jason Hunter <[email protected]> wrote:

> From: Jason Hunter <[email protected]>
> Subject: Re: [jdom-interest] Fw: How to date type conversion between xml and Java
> To: "Jack Bush" <[email protected]>
...
> Use java.text.SimpleDateFormat. 
> It can parse the date string, lets you interact with it as
> data, and helps you reformat it if you need.
> 
> Note it's relatively slow because of its complex
> internals.  If your dates are always in the exact same
> simple format like you showed, and you need to parse a huge
> number of them, a simple custom parser based on character
> positions can be much faster.

Also, might want to consider Joda library, which is an improvement over JDK defaults, both in functionality and (I think) with respect to efficiency. Can usually just construct DateTime out of typical (ISO-8601) date Strings.

-+ Tatu +-




      

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.