# month

Extracts the month component from a timestamp.

```tql
month(x: time) -> int
```

## Description

The `month` function extracts the month component from a timestamp as an integer (1-12).

### `x: time`

The timestamp from which to extract the month.

## Examples

### Extract the month from a timestamp

```tql
from {
  ts: 2024-06-15T14:30:45.123456,
}
month = ts.month()
```

```tql
{
  ts: 2024-06-15T14:30:45.123456,
  month: 6,
}
```

## See Also

* [`year`](https://preview.docs.tenzir.com/375/375/reference/functions/year.md)
* [`day`](https://preview.docs.tenzir.com/375/375/reference/functions/day.md)
* [`hour`](https://preview.docs.tenzir.com/375/375/reference/functions/hour.md)
* [`minute`](https://preview.docs.tenzir.com/375/375/reference/functions/minute.md)
* [`second`](https://preview.docs.tenzir.com/375/375/reference/functions/second.md)
* [Work with time](https://preview.docs.tenzir.com/375/375/guides/transformation/work-with-time.md)