---
schema_version: "1"
id: 993d924ec0878ffad8e4646890094fa87cc2ba60f7b166eedc6aa05902374c60
title: DATETIMEVALUE
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_datetimevalue.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_datetimevalue.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4ba0c2d3ed46570173bfd066bd10d10445f9c9a715f9f53935c7e3e0fb075256
description: Returns a year, month, day, and GMT time value.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# DATETIMEVALUE

Returns a year, month, day, and GMT time value.

## Use

`DATETIMEVALUE(expression)` and replace expression with a date/time or text value, merge field, or expression.

## Tips

- DATETIMEVALUE is always calculated using GMT time zone and can’t be changed.
- When entering a specific date, surround the date with quotes and use the following 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!

![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

`DATETIMEVALUE(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

`DATETIMEVALUE("2005-11-15 17:00:00")` returns November 15, 2005 5:00 PM GMT as a date and time value.