日期:2014-05-16  浏览次数:20319 次

mybatis日期配置DATE,jstl用fmt:formatDate出现的日期格式问题

mybatis 中

??? <result column="CRETE_TIME" property="createTime" jdbcType = "TIMESTAMP" />

用fmt:formatDate标签在Jsp显示日期和时间
为什么日期显示的是正确的,但是时间显示总是12:00:00

解决:方法一:去掉jdbcType = "TIMESTAMP"

方法二:

mybatis jdbcType: DATE ,TIMESTAMP 区别:

1. mybatis中 jdbcType 时间类型

当jdbcType = DATE 时, 只传入了 年月日

jdbcType = TIMESTAMP , ?年月日+ 时分秒