Returns a date value for a date/time or text expression.
As of Winter ’20, the DATEVALUE() formula option provides more accurate daylight savings time values without workarounds. The option avoids an existing one-hour discrepancy when processing times between 11:00 PM and 1:00 AM. From Setup, in the Quick Find box, enter Company Information. Under Locale Settings, select Improve DATEVALUE() accuracy for DST.
Important 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.
Use
DATEVALUE(expression) and replace expression
with a date/time or text value, merge field, or expression.
Tips
- If the field referenced in the function isn't a valid text or date/time field, the formula field displays #ERROR!
- When entering a date, surround the date with quotes and use this format: YYYY-MM-DD, that is, a four-digit year, two-digit month, and two-digit day.
- If the expression doesn't match valid date ranges, such as the MM isn't between 01 and 12, the formula field displays #ERROR!
- Dates and times are always calculated using the user’s time zone, except in list views, reports, and related lists. These items calculate dates and times using Coordinated Universal Time.
Closed Date Example
DATEVALUE(ClosedDate) displays a date field based on the
value of the Date/Time Closed field.
Date Value Example
DATEVALUE("2005-11-15") returns November 15, 2005 as a
date value.