---
schema_version: "1"
id: ab78c4e4712ba261f02efad0e8da0d35e34b12788070a3b6cb32b2d1ebd840f5
title: DATEVALUE
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_datevalue.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_datevalue.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 622af0fca480cf261d1148ffa5a8b2660a43724a801e4d4acaab83d4eacb4604
description: Returns a date value for a date/time or text expression.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# DATEVALUE

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_important.png)

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Closed Date Example

`DATEVALUE(ClosedDate)` displays a date field based on the value of the Date/Time Closed field.

![Date Value Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Date Value Example

`DATEVALUE("2005-11-15")` returns November 15, 2005 as a date value.