DATEVALUE() formula fields are incorrect in Reports and Visualforce due to daylight savings
Analytics , Apex , VisualForce
Last updated 7 days ago ·Reference W-869341 ·Reported By 246 users
In Review
Summary
1. Reports and Visualforce components relying on a Date/Time format field may be off by an hour during Daylight Savings Time.
2. This can also present different values in records in lightning vs. classic. This is due to how and when the DATEVALUE currently truncates the time from the Date/Time field.
Repro
Formulas using the DateValue() function display as being off by one hour when displayed on Reports or Visualforce.
As an example for scenario 2 listed above,
Consider the following formula:
DATEVALUE(Random_DateTimeField__c)
Workbench shows the Random_DateTimeField__c to have a value of:
2018-06-18T04:00:00.000Z
Lightning will display the date at 6/17/2018
Classic will display the date at 6/18/2018
Workaround
It is recommended that date/time fields that intend to have the DateValue() function used on it should not be defined between 11pm and 1am. Doing so may cause the Date to be translated into an incorrect Date.
Alternately, updating your user timezone may return desirable results.
Reported By (246)






















































































































































Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.