Webcam Chat QuickBooks Advice international calling cards international phone cards
JavaBeat Java Books Certifications Certifications Kits Articles Tutorials Tips QNA Book Store Interview Questions SCJP 1.5 SCJP 1.6 SCWCD 5.0 SCBCD 5.0 SCEA SCJA Feeds
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 Object

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

Add your comments

 

JavaBeat Website (2004-2011), India
javabeat | advertise | about us | contact | useful resources
Copyright (2004 - 2011), JavaBeat


Technology Blogs
Technology blogs Technology Blogs
blog log