Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Extend Salesforce with Clicks, Not Code
DATETIMEVALUE

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
Closed Date Example

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

Date Value Example
Date Value Example

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

 
Loading
Salesforce Help | Article