When I convert this String to TimeStamp by using the method TimeStamp.valueOf(string), it adds '.0' at the end of TimeStamp. However I want it in the same format as of string but the data type should be TimeStamp.
String myStr = "2021-08-25 09:46:26";
TimeStamp dateTime = TimeStamp.valueOf(mystr);
returns 2021-08-25 09:46:26.0
I've also tried SimpleDateFormat with pattern "yyyy-MM-dd HH:mm:ss", but it also ruins the format.