// parse date retaining the time of the submission
dateTime = format.parseDateTime(value);
}
catch (RuntimeException e)
{
throw new ConversionException(e);
}
// apply the server time zone to the parsed value
if (zone != null)
{
dateTime = dateTime.withZoneRetainFields(DateTimeZone.forTimeZone(zone));
}
return dateTime.toDate();
}
else
{
try
{
DateTime date = format.parseDateTime(value);
return date.toDate();
}
catch (RuntimeException e)
{
throw new ConversionException(e);
}
}
}