Thanks!
How about changing it from (2) back to (1)?
I may need to extract the YYYY-MM-DD format from the cloudscape DB and display it in a meaningful date format. Any clue how to do this?
Thanks once again!
Main Topics
Browse All TopicsHi,
I'm new to the area of JSP Programming. Hope someone can help me out with this:
I need to insert a date value into my Cloudscape database.
(1) java.util.Date provides the date in the format: Sun Oct 19 17:01:53 GMT+08:00 2003
(2) but cloudscape can only take in the value of the format: YYYY-MM-DD
how can I do the date format conversion from (1) to (2)?
Thanks for any help in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
oh,
i managed to find out how to change from
YYYY-MM-DD to Sun Oct 19 17:01:53 GMT+08:00 2003 in the following manner:
SimpleDateFormat sdfInput = new SimpleDateFormat( "yyyy-MM-dd" );
SimpleDateFormat sdfOutput = new SimpleDateFormat ( "MM/dd/yyyy" );
java.util.Date date = sdfInput.parse( newFormat );
However, when i execute the following statement to print the value of date,
System.out.println( "Back to Date again: "+date);
it gives:
-> Sun Oct 19 00:00:00 GMT+08:00 2003
If u noticed, the time is gone.
Thus, my qn is, given 2 Strings, time and date,
is it possible to use SimpleDateFormat to re-create a Date object that contains both the time and date?
Business Accounts
Answer for Membership
by: kotanPosted on 2003-10-19 at 02:18:15ID: 9578546
import java.text.SimpleDateFormat ;
dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-
String newFormat = sdf.format(date);