If you need it only in puntual cases, you can register a custom editor attached to the field in the form:
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy", this.getLocale(context)); DateFormat dateTimeFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss SSS", this.getLocale(context)); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateTimeFormat, true)); binder.registerCustomEditor(Date.class, "name.of.input", new CustomDateEditor(dateTimeFormat, true));
source share