这是我的pojo类方法:
@Column(name = "TH_EFFECTIVE_TIME")
private Date thEffectiveTime;
public Date getThEffectiveTime() {
return thEffectiveTime;
}
public void setThEffectiveTime(Date thEffectiveTime) {
this.thEffectiveTime = thEffectiveTime;
}
我的输出错误如下:
1445925903000
答案 0 :(得分:0)
试试这个。 Temporal将转换您的时间戳。请记住将其保留为unix时间戳。你的是ms而不是秒。
@Temporal(TemporalType.DATE)
@Column(name = "TH_EFFECTIVE_TIME")
private Date thEffectiveTime;
public Date getThEffectiveTime() {
return thEffectiveTime;
}
public void setThEffectiveTime(Date thEffectiveTime) {
this.thEffectiveTime = thEffectiveTime;
}