A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Converting Date between Java and DB
Morley Yeung
Greenhorn
Joined: Jun 19, 2001
Posts: 8
posted
Jul 02, 2001 20:45:00
0
How can I convert the Date between Java's Date class and the DB's Date datatype?
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
Jul 03, 2001 09:31:00
0
Hi Morley,
You can just do the following:
java.util.Date d1 = new java.util.Date(); java.sql.Date d2 = new java.sql.Date( d1.getTime() );
Regards,
Manfred.
Morley Yeung
Greenhorn
Joined: Jun 19, 2001
Posts: 8
posted
Jul 04, 2001 01:59:00
0
Thank you very much.
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Converting Date between Java and DB
Similar Threads
Between Syntax
comparing dates in db2
how to get duration starting date to ending date in visual jsf
date difference
Date difference
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter