2023-05-19 16:02转换为LocalDateTime
时间: 2023-08-05 19:30:47 浏览: 124
mysql的timestamp类型字段为'0000-00-00 00:00:00'导致mybatis映射时报错解决方法
2023-05-19 16:02可以转换为LocalDateTime对象,示例代码如下:
```java
String dateTimeStr = "2023-05-19 16:02";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime dateTime = LocalDateTime.parse(dateTimeStr, formatter);
System.out.println(dateTime);
```
输出结果为:
```
2023-05-19T16:02
```
阅读全文