I need to concat two strings together in Java and then format the string and make it a Date object.
The two strings that I have at the moment are 31/01/2012 and 20:00 and I want to do something like:
try {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm");
Date result = new Date();
String tempDate = date + " " + f;
result = formatter.parse(tempDate);
} catch (ParseException e) {
...etc
}
Can someone help me figure how to add the two strings together. Any help would be appreciated!
Your concatenation is fine. Yet it seems that your format is
"dd/MM/yyyy HH:mm"