{
// parse date retaining the time of the submission
int result = format.parseInto(dt, value, 0);
if (result < 0)
{
throw new ConversionException(new ParseException("unable to parse date "
+ value, ~result));
}
}
catch (RuntimeException e)
{
throw new ConversionException(e);
}
// apply the server time zone to the parsed value
dt.setZone(getTimeZone());
return dt.toDate();
}
else
{
try
{
DateTime date = format.parseDateTime(value);
return date.toDate();
}
catch (RuntimeException e)
{
throw new ConversionException(e);
}
}
}