Problems Formatting Date
Hi,
I cannot seem to get the date to format correctly.
I initially have: 2007-04-11
I want to have: 4/11/2007 4:00:00 PM
Here is what I am doing:
DateFormat dateFormatA =new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
DateFormat dateFormatB =new SimpleDateFormat("M/d/yyyy h:mm:ss a");
dateFormatB.setLenient(false);
date = dateFormatA.parse(date.toString() +" " + crsCapacity.getString("Hour") +":00:00");
date = dateFormatB.parse(dateFormatB.format(date));
But I cannot get the correct format to appear.
I get Wed Mar 21 16:00:00 EDT 2007.
dateFormatB.format(date) works fine. It ouputs exactly what I want but as a String. I need to use this String to update a Timestamp field in a DB.
Any help will be greatly appreciated.
Thanks!

