Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert Calendar to java.sql.Date

 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

In my project I am having a situation like this.

I have the Calendar object.

I have to convert it into java.sql.Date object.

Can you give the code for that.

Thanks for your comments.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a big hint.
See the java.sql.Date constructor ? It takes an long as parameter, representing the time in millisecs.
Which method from Calendar can return the time in millisecs ?
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou,

I got it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic