|
|||||||||
|
Submit Links |
Latest Links
| Login
(want to submit links for DLinks? send a mail to krishnas@javabeat.net)
Convert a java.util.Date Object to a java.sql.Date Objectsubmited by krishnas on Fri Aug 31st, 2007 Average Rating: 1/5 | Rate this item | 1 user has rated this item. Expertise: Intermediate Language: Java August 21, 2007 Convert a java.util.Date Object to a java.sql.Date Object The following code demonstrates how to convert a java.util.Date object to a java.sql.Date object: import java.sql.*; import java.util.*; public class cs{ public static void main(String[] args) { GregorianCalendar date_1=(GregorianCalendar)Calendar.getInstance(); System.out.println(date_1.getTime()); java.sql.Date date_2= new java.sql.Date((date_1.getTime()).getTime ()); System.out.println(date_2); } } Anghel Leonard If you have a hot tip and we publish it, we'll pay you. However, due to accounting overhead we no longer pay $10 for a single tip submission. You must accumulate 10 acceptable tips to receive payment. Be sure to include a clear explanation of what the technique does and why it's useful. If it includes code, limit it to 20 lines if possible. Submit your tip here. DevX: Java Zone Browse "Java" Tips Browse All Tips Browse "SQL" Tips Was this article useful? Please log in to rate this item. Don't have a log in? Get one now.Topic: java |
|||||||||
|
|||||||||