JPA TemporalType.Date giving wrong date

前端 未结 6 1134

I have a class that has a date field representing a \"valid from\" date for a piece of data. It is defined like this:

@Temporal( TemporalType.DATE )
private          


        
6条回答
  •  旧时难觅i
    2020-12-04 17:52

    I was experiencing this same issue but I was using JSF 2 as the front end. If you are using JSF components look at this other stackoverflow discussion and see that JSF 2 does not play by the expected TimeZone rules. The designers Implemented it to always use GMT. In my situation this caused my Dates to be off by 5 or 6 hours in the database, but display correctly.

    JSF convertDateTime renders the previous day

提交回复
热议问题