cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with saving/displaying dates in Backoffice, seemingly connected to daylight saving

Former Member
0 Kudos
901

We have encountered a weird issue when entering dates in Backoffice. For example when entering a date today (during daylight saving time) of 04.01.2016 00:00:00, it seems to be saved as 03.01.2016 23:00.00 (CET) in the database. So when formatting this date to a String you would also get "03.01.2016", which is wrong. The problem also occurs when saving a date of 04.01.2016 00:00:00 in the java code, which is then displayed as 04.01.2016 01:00:00 in the Backoffice. Is there some property we can set, or other means to deal with this problem? We would expect that exactly the date entered is saved in the database. Thanks in Advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Hi,

In backoffice listview label provider displays the timezone in server timezone ,where as in editor area date & time editors are in the timezone of user. Date is stored as timestamp(moment of time in db) , because of timezones its getting displayed in such way !

check this link to set timezone for an editor https://help.hybris.com/1808/hcd/8baaee208669101492bbcf156de5928f.html

if that doesn't help you can create your own editor extending these editors and set the timezone. Incase of list view you need to check "DefaultDateLabelProvider" and override it accordingly.

0 Kudos

In case of listview, after overriding "DefaultDateLabelProvider", u should reconfigure in ur *-backoffice-config.xml:

<context type="java.util.Date" component="base">
<y:base>
<y:labels beanId="yourOverridingBean"/>
</y:base>
</context>

0 Kudos

Whats the solution?