数据库中的日期类型处理:Timestamp

数据库中的日期类型处理:Timestamp

 

Cannot convert of type class java.sql.Timestamp to class org.joda.time.DateTime

 

1,

Add this annotation on your DateTime field in your entity class

@Type(type="org.joda.time.contrib.hibernate.PersistentDateTime")

private DateTime birthDay;

And in your JSP, keep using the joda format tag:

 

 

2,sql中采用to_char(T.WL_TIME,'yyyy-mm-dd hh24:mi:ss')//这种最省事

 

你可能感兴趣的:(其他)