pojo: private Date ma004;
mapper:
<select id="getListByTitle" parameterType="String" resultType="com.hw.hwsafe.smart.pojo.S004PO"> select MA001, MA002, MA003, MA004, MA005, MA006, MA007 from S004 where MA002 = #{ma002} </select>
orcale数据库ma004的Type为:DATE
struts2 Action: titleList=s004Service.getListByTitle(title);return JSON_DATA;
打印的json串为:
{"dataObject":[{"ma001":"a","ma002":"v","ma004":{"date":9,"day":3,"hours":12,"minutes":7,"month":6,"seconds":0,"time":1404878820000,"timezoneOffset":-480,"year":114},"ma005":"1","ma006":"","ma007}],"message":"查询成功"}
我想在页面显示ma004:yyyy-mm-dd hh:mm:ss的这种时间格式,怎么办?
会mybaits的大神帮我看看啊,谢谢
既然你都有json数据了。你可以直接把time属性,用js转换。比如new Date(1404878820000),拿到日期了,就好搞了。
其他方式就是在转json的时候,将日期进行转换。