---
schema_version: "1"
id: 56829e25eba37133e263f3825f7411b23c8cf1cb675660990b1107d61896d731
title: datevalue
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_function_ref_datevalue.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_datevalue.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 3643c7872f27c9d67061255b3bc4d541b960c0377e56037fda4d626918a24085
description: 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.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# datevalue

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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available for an additional cost in: <strong>Professional</strong> Edition with Web Services API Enabled</td></tr></tbody></table>

## 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.