[jdom-interest] Fw: How to date type conversion between xml and Java

Jack Bush netbeansfan at yahoo.com.au
Sun Aug 15 20:41:33 PDT 2010


Hi All,

 
I need some advice on how to store the following date value from a xhtml 
document using JPA:
  
  <p>    
      <strong>Time:</strong> 
      <time>13/08/2010 00:10:19 am</time> 
  </p>
 
There is no problem retrieving this value using XPath query. However, the value 
returned is of type string yet JPA (futureStock.setCollectionTime()) expects 
type java.util.Date such as the following code snippet:
 
    org.jdom.Element collection_time = 
((org.jdom.Element)time_element).getChild("time");
    futureStock.setCollectionTime(collection_time.getTextNormalize());
 
I would like to be in a position to retrieve both date and time separately and 
date comparison at a 

later stage.
 
Any idea on how to overcome this issue? 
Thanks a lot,
Jack


      




More information about the jdom-interest mailing list