String str = localDateTime.toString().replace("T", " "); 格式:yyyy-MM-dd hh:mm:ss 结果:2022-05-25 17:21:57