I have an old string value as below
2018-03-21 00:00:00.0
I would like to change the time to 23:18:19
but remain the date as 2018-03-21.
So the new value will be 2018-03-21 23:18:19
.
This is what I have tried
System.out.println("date is " + date); // 2018-03-21 00:00:00.0
String[] parts = date.split(" ");
System.out.println("Date: " + parts[0]); // 2018-03-21
System.out.println("Time is : " + parts[1]); // 00:00:00.0
String replaceString=parts[1].replace(?,'23:18:19');
System.out.println("Value is : " + replaceString); //2018-03-21 23:18:19
What should I put in the ?
?