File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert java.util.Date to java.sql.Date

 
Kop Ite
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi
I am trying to convert a java.util.Date into java.sql.Date as below:
java.util.Date aDate
(java.sql.Date) aDate
< where aDate = Mon Nov 11 00:00:00 GMT 2002 >
I am getting exception:
java.lang.ClassCastException: java.util.Date
How do I sort this out so it will work remembering that aDate value is set in stone, so nothing can be done with that, must be converted into java.sql.Date.
Help !!
thanks
 
James Swan
Ranch Hand
Posts: 403
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Kop Ite
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks works a treat
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic