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

# WEEKDAY

> Returns the weekday number with Monday numbered zero.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

Returns NULL for NULL input.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
weekday(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | TIMESTAMP | Yes | Timestamp whose weekday is extracted. |

## Returns

* Type: INTEGER
* Possible values: 0 (Monday) through 6 (Sunday).
* NULL behavior: Returns NULL for NULL input.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Exact result | Yes |

## Examples

### Friday

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT weekday(TIMESTAMP '2024-03-15 00:00:00') AS result;
```

| result |
| - |
| 4 |

### Monday

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT weekday(TIMESTAMP '2024-03-18 00:00:00') AS result;
```

| result |
| - |
| 0 |

### Sunday

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT weekday(TIMESTAMP '2024-03-17 00:00:00') AS result;
```

| result |
| - |
| 6 |

## Limitations

* This form takes TIMESTAMP. DATE input requires conversion to TIMESTAMP.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.