I am using MySQL and have a column type TimeStamp. I am not able to store or retrieve milliseconds.
Any help please ? Thanks!
public static Date getBeginAndEndTime(String time) {
DateTimeFormatter format = DateTimeFormatter.ofPattern("HHmmssSSS");
LocalTime lt = LocalTime.parse(time, format);
return Timestamp.valueOf(lt.atDate(LocalDate.now()));
}
Ex: Time value coming as is "140833222" and when I stored in database it looks like "2020-08-26 14:08:33" missing last milliseconds "222".
I need to store and retrieve including milliseconds.