Updated code
This commit is contained in:
@@ -92,6 +92,10 @@ public class DateTimeUtil {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||
return LocalDateTime.parse(dateTimeStr, formatter);
|
||||
}
|
||||
public static LocalDateTime parseStringToLocalDateTime(String timestampStr) {
|
||||
// Use ISO_LOCAL_DATE_TIME to parse the input string
|
||||
return LocalDateTime.parse(timestampStr, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
||||
}
|
||||
|
||||
public static String parseLocalTimeToString(LocalTime time, String format) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
|
||||
Reference in New Issue
Block a user