cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

What is the difference between java.sql.date and java.util.date

Former Member
0 Likes
744

Hi All,

What is the difference between java.sql.date and java.util.date and which is more preferable to use .How to convert date from one form to another .

Thanks.

View Entire Topic
Former Member
0 Likes

Hi

And also see This how to change date from one form to other..

How to change a date value from "java.util.Date" to

> "java.sql.Date"?

<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html">java.util.Date</a> date = // date

<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Date.html">java.sql.Date</a> sqlDate = new <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Date.html#Date(long)">java.sql.Date(</a> date.<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#getTime()">getTime()</a> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Date.html#Date(long)">)</a>

Urs GS