I have an issue related to retrieving time from time stamp. Below is the code, I get the timestamp from gui, which I need to convert into hh:mm:ss and insert into database.
LocalDate timestamp = LocalDate.parse(getOfferingLetter().getCreatedTimeStamp(),DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS"));
Timestamp.valueOf(timestamp.atStartOfDay();
The above code retrieves date like this 2022-04-08 00:00:00.0
. I need the time to be retrieved like this 00:00:00
, how do I do this without using SimpleDateFormat
?
Well, this will give you the time:
But you cannot create Timestamp from LocalTime.