How to convert Calendar to java.sql.Date in Java?

The Solution to How to convert Calendar to java.sql.Date in Java? is


There is a getTime() method (unsure why it's not called getDate).

Edit: Just realized you need a java.sql.Date. One of the answers which use cal.getTimeInMillis() is what you need.

~ Answered on 2012-02-02 13:04:01


Most Viewed Questions: