---
title: "mybatis日期配置DATE,jstl用fmt:formatDate出现的日期格式问题"
author: "MatthewMay"
date: "2014-03-13T14:03:10Z"
tags: ["JSTL"]
categories: ["编程语言"]
slug: "mybatis-date-jstl-fmt-formatdate"
draft: false
lastmod: "2014-03-13T14:03:10Z"
id: 2030461
url: "https://matthewmay.iteye.com/blog/2030461"
---

mybatis 中

    &lt;result column="CRETE\_TIME" property="createTime" jdbcType = "TIMESTAMP" /&gt;

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

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

方法二：

mybatis jdbcType: DATE ,TIMESTAMP 区别:

1\. mybatis中 jdbcType 时间类型

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

jdbcType = TIMESTAMP ,  年月日+ 时分秒