Spring mvc 检索时将Oracle数据库中的日期格式(yyyy-mm-dd)更改为(yyyy-mm-dd hh-mm-ss)
我在SpringMVC中发现了一个奇怪的行为,我将出生日期保存为date格式,并将其get-write在oracle db中保存为相同的格式,但在检索时它被转换为dateTimeStamp格式 请帮帮我 提前感谢问题已解决Spring mvc 检索时将Oracle数据库中的日期格式(yyyy-mm-dd)更改为(yyyy-mm-dd hh-mm-ss),spring-mvc,oracle11g,Spring Mvc,Oracle11g,我在SpringMVC中发现了一个奇怪的行为,我将出生日期保存为date格式,并将其get-write在oracle db中保存为相同的格式,但在检索时它被转换为dateTimeStamp格式 请帮帮我 提前感谢问题已解决 DateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S"); Date date = inputFormat.parse(inputDate); // Format d
DateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");
Date date = inputFormat.parse(inputDate);
// Format date into output format
DateFormat outputFormat = new SimpleDateFormat("dd-MM-yyyy");
String outputString = outputFormat.format(date);
在发布问题之前,请先查看和。