JPA TemporalType.Date giving wrong date

前端 未结 6 1118

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条回答
  •  北海茫月
    2020-12-04 17:45

    But using DATETIME instead of date will lead to a one hour (ore more depending the time zone) difference, which you may ignore if you handle a date, but not a time value. For me the data coming from the mysql database was the correct value, but the difference came in when using the f:convertDateTime without a timeZone paramater, which leads to a default of using GMT!

    
      
    
    

    works fine, but I think this will work no more when we switch to CEST ....

提交回复
热议问题