Converts a string or object that represents a date or time value into an integer in Salesforce Spiff. The integer represents the elapsed days since December 30, 1899. This function helps you compare date values more easily.
Required Editions
| Available in: both Salesforce Classic (not available in all orgs) and Lightning
Experience |
| Available in: Enterprise, Unlimited, and Developer
Editions |
| Available for an additional cost in: Professional Edition with Web
Services API Enabled |
Syntax
datevalue(string_or_object)
Arguments
| Argument |
Required? |
Description |
| string_or_object |
Required |
The string or object that represents a Date or Date & Time value. Strings must be in YYYY-MM-DD format, enclosed in double quotes. |
Example
Convert the date August 1, 2023.
=datevalue("2023-08-01")
This formula returns 45139, the number of days elapsed between December 30, 1899 and August 1, 2023.