Timestamp类型的"2016-03-29 10:20:34.0" 有什么方法可以把后面的毫秒去掉吗??
只要"2016-03-29 10:20:34"
谢谢!!!
PHPz2017-04-18 09:42:08
For JSP pages, you can use tags to format them:
<fmt:formatDate value="${xxxxxx}" pattern="yyyy-MM-dd HH:mm:ss"/>
TimeStamp can be converted to String type in Java. For conversion, please refer to:
public String timeSplitMs(Timestamp ts) {
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
if (null != ts) {
return sdf.format(ts);
}
} catch (Exception e) {
logger.warn("TimeStamp转换String格式出错", e);
}
return null;
}