Java Date Conversion Examples

Java Date Conversion Examples

In this tutorial, I am attaching some programs about, Java Date Conversion Examples. such as Converting java.util.Date to java.sql.Date and Converting java.sql.Date to java.util.Date. same Java Date Conversion Examples has been shared in the post.

Converting java.util.Date to java.sql.Date

Converting java.sql.Date to java.util.Date

Final Example

DateConversion.java

Output

2016-11-28 (class java.sql.Date)
Mon Nov 28 14:55:51 IST 2016 (class java.util.Date)

References

1. java.util.Date API
2. java.sql.Date API