---
schema_version: "1"
id: 1c0ec236156dfc56ad5b7c8811ff64009777570c9237c092604e54fec7a11da7
title: beginning_of_day
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_function_ref_beginning_of_day.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_beginning_of_day.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4e133ebc9097981cd0af39084c24d61dcb0dedaf76f540d7dbc80a43b33c43b0
description: Returns the first second for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DDT:hour:minute:second:millsecond, plus or minus the hours and minutes away from Coordinated Universal Time (UTC).
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# beginning\_of\_day

Returns the first second for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DDT:hour:minute:second:millsecond, plus or minus the hours and minutes away from Coordinated Universal Time (UTC).

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

```
beginning_of_day(date_or_time)
```

## Arguments

  
| Argument | Required? | Description |
| --- | --- | --- |
| date\_or\_time | Required | The Date or Date & Time value to evaluate. This argument supports any date functions. |

## Example

Return the beginning of the day that represents the start of the statement period, using the BeginningOfPeriod helper function.

```
=beginning_of_day(BeginningOfPeriod)
```

Find the beginning of the day from a text-formatted date, which you can convert to a proper Date data type with the `date()` function.

```
=beginning_of_day(date("2024-01-31"))
```

Create a data filter that return all deals created between January 1 and 31. Combine this function with `end_of_day()`.

```
CreatedAt >= beginning_of_day(date("2024-01-01")) AND CreatedAt <= end_of_day(date("2024-01-31"))
```

Update the previous data filter with dynamic statement period dates instead of hard-coded text values.

```
CreatedAt >= beginning_of_day(date(statement_period.start_date)) AND CreatedAt <= end_of_day(date(statement_period.end_date))
```

#### See Also

- [Helper Functions in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_functions_helper.htm&release=264.0.0&type=5 "Helper functions in Salesforce Spiff save time and provide clarity. A helper function is interchangeable with a standard function, but uses simpler syntax so you can create logic more easily.")
- [date](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_date.htm&release=264.0.0&type=5 "Converts a string into a Date data type in Salesforce Spiff. This function finds the date value for a field that isn't specifically a Date data type so that Spiff can use the date value in calculations and other functions related to dates.")