> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cfo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Date-truncation functions

Date-truncation functions return the start of the period that contains a date.

## startofday

```text theme={null}
startofday(Date.Day)
```

Returns the start of the day.

## startofweek

```text theme={null}
startofweek(Date.Week)
```

Returns the Monday at the start of the week.

## startofmonth

```text theme={null}
startofmonth(Date.Month)
```

Returns the first day of the month.

## startofquarter

```text theme={null}
startofquarter(Date.Month)
```

Returns the first day of the calendar quarter.

## startofhalf

```text theme={null}
startofhalf(Date.Month)
```

Returns January 1 or July 1 for the half-year containing the date.

## startofyear

```text theme={null}
startofyear(Date.Month)
```

Returns January 1 of the year.

These functions are useful when source dates must be aligned with a model period.
