Briefly this is due to having used a Date Time property to represent a Date value.
A Date property would have been more appropriated in this case avoiding the occurrence of this issue.
More in detail the root cause is the particular combination of HTML controls used to assign a Date value to the Date Time property in the Work Item and for showing this property as date in the Report Definition.
Using the Calendar control in the section with Date mode means assigning 00:00 to the time part of the Date Time property.
With the time zone conversion being involved in this case the date time property is shifted to the day before.
E.g.. the date 20160101 in theEurope/Berlintime zone is converted to 20151231T230000.000 GMT
This is normally not an issue with Date Time properties as the opposite conversion happens when the date is retrieved from the database.
Use the appropriate property type whenever is possible to avoid the risk of incurring in this issue. Assuming you cannot change your Data Model (which would be more correct) there are two mutually exclusive ways to work-around this issue:
Create a custom HTML control to render the Date Time property as a Date and include this custom control in the Report Definition.
Use a SQL function alias rule to adjust the SQL Date to the Application Server time zone.
The custom HTML Control can been created saving the OOTB Export_DateTimeas Export_DateTime_Custom and changing line 8 of the HTML source
from: sDatetime=PRDateFormat.format(null,strTimeZone,PRDateFormat.DEFAULT_DATETIME_SHORT,curProp.toDate()); to: sDatetime=PRDateFormat.format(null,strTimeZone, "dd.MM.yyyy",curProp.toDate());
Adopt the Date pattern that best suits your needs.
The following screen shot depict the modified HTML Control with the current change highlighted:
The second solution albeit viable is less desirable as it depends on the database in use.
1) Do you ever take a date, change it to a date-time, then change it back to a date? This can cause the kind of problem you're seeing, Or vice versa.
2) What time zone is your db server set to compared to the time zone of your app server? Make them the same!
3) If a time stamp is too close to midnight, or too close to the "top of the hour", such things can happen. If possible, stay away from those confusing times when using time stamps. For instance, use 12:05 instead of 12:00.
Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.
You may also refer this discussion link as a reference in the new thread.