Before I had a chance to try this one, someone gave me this one:
Code:
public static String oracleDatePrep(java.util.Date dateIn)
{
SimpleDateFormat oracleDateFormatter = new SimpleDateFormat("dd-MMM-yyyy");
String returnVal = null;
if (dateIn != null)
{
returnVal = oracleDateFormatter.format(dateIn);
}
return returnVal;
}//End oraclePrep
public static java.util.Date parseToDate(String dateString)
{
if (dateString == null)
{
return null;
}
java.util.Date returnDate = null;
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
formatter.setLenient(false);
if (dateString.length() != 0)
{
try
{
returnDate = formatter.parse(dateString);
}
catch (ParseException pe)
{
}
}
return returnDate;
}//End parseToDate
that I call like
Code:
oracleDatePrep(parseToDate("20030701"))
Thanks for your suggestions and help in the other threads!