将时间字符串格式化为时间: val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") val head_date = LocalDate.parse("1992-05-10 00:00:00",formatter ) 将时间转换为字符串 val f= DateTimeFormatter.ofPattern("yyyy-MM-dd") val str: String = head_date.format(f)