DATEVALUE() formula fields are incorrect in Reports and Visualforce due to daylight savings
Last updated 2 days ago ·Reference W-869341 ·Reported By 315 users
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.
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:
Workbench shows the Random_DateTimeField__c to have a value of:
Lightning will display the date at 6/17/2018
Classic will display the date at 6/18/2018
Go to Setup, in the Quick Find box, enter Company Information. Under Local Settings, select Improve DATEVALUE() accuracy for DST. If your org’s custom formulas include workarounds that adjust date values between 11:00 PM and 1:00 AM, remove them before enabling this setting. If you don’t remove the workarounds, your data could be inaccurate. Enabling the preference can also increase the compiled size of existing formulas with the DATEVALUE() function.
Reported By (315)
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.