I'm trying to add a record in my DDL by DDLRecordLocalServiceUtil.addRecord() but I can't find which format to give into the fields map, it always add the record with "1/1/70".
I'm doing like this:
Map<String,Serializable> test = new HashMap<String, Serializable>();
test.put("date-value", "21/04/1983");
test.put("number-value", 15);[/code]
I tried with "04/21/1983" and with - instead of / but it always ignore my date...
How can I fix this?
Since you're passing a Serializable object who's value is a String Liferay doesn't know that "04/21/1983"
is a Date
and will insert it as a String. I think you should pass a Date
object and use SimpleDateFormater to convert your string to a date:
SimpleDateFormat dateFormatter = new SimpleDateFormat("mm/dd/yyyy");
test.put(dateFormatter.parse("21/04/1983"));
SOLUTION FOUND : SEE IN COMMENTS