# DATE_PART() Function

### Description

Extracts a specified part of a date or timestamp.

#### Supported parts

| Part | Aliases | Returns |
| --- | --- | --- |
| `year` | `y`, `yy`, `yyyy`, `yr` | Calendar year |
| `quarter` | `q`, `qtr` | Quarter (1–4) |
| `month` | `mm`, `mon` | Month (1–12) |
| `week` | `w`, `wk`, `woy`, `weekofyear` | ISO week of year |
| `day` | `d`, `dd`, `dayofmonth` | Day of month |
| `day_of_week` | `dow`, `dw`, `dayofweek`, `dayofweekiso` | ISO weekday (Monday=1 through Sunday=7) |
| `day_of_year` | `doy`, `dy`, `dayofyear` | Day of year (1–366) |
| `year_of_week` | `yow`, `yearofweek`, `yearofweekiso` | ISO year of the week |
| `hour` | `h`, `hh`, `hr` | Hour |
| `minute` | `m`, `mi`, `min` | Minute |
| `second` | `s`, `sec` | Second |
| `timezone_hour` | `tzh` | Time zone offset hours |
| `timezone_minute` | `tzm` | Time zone offset minutes |

### Syntax

```sql
DATE_PART(part, date_or_timestamp)
```

### Parameters

| Parameter | Description | Data Type | Required |
| --- | --- | --- | --- |
| _part_ | Date or time part to extract (for example month, day, year) | String | Yes |
| _date\_or\_timestamp_ | Date or timestamp value to extract from | Date or timestamp | Yes |

#### Notes

-   Alias for `EXTRACT(part FROM date_or_timestamp)`

### Example

```sql
SELECT
    DATE_PART('month', start_date)
FROM
    rippling.employee.Employee
LIMIT
    5;
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/date_part

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
