In the java class, I get the date as the string say "renewDate" from the datepicker-input form in mm / dd / yyyy.
When I try to update code using joda time library
DateTime expireDate = new DateTime(renewDate);
updateOrganization.setRenewdate(expireDate.toDate());
organizationDAO.update(updateOrganization);
but if I format the date in the form ie, from mm / dd / yyyy to yyyy-mm-dd and send it to the java class, this will work fine.
How can I format a date from mm / dd / yy to yyyy-mm-dd in a Java class. Input is Stringformat.
source
share