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

# Addhours

# \$addHours

The `$addHours` operator adds a specified number of hours to a date object.

## Input

* An array containing a date object and a numeric number of hours to add

## Output

* A new date object with the specified number of hours added

## Examples

### Add Hours to Date

```json theme={null}
{
  "$addHours": [
    {
      "$toDate": ["2023-01-15T10:30:00Z"]
    },
    5
  ]
}
```

Result: `Date object representing January 15, 2023 at 15:30:00 UTC`

### Add Hours to Field Value

```json theme={null}
{
  "$addHours": [
    {
      "$input": "start_time"
    },
    {
      "$input": "hours_to_add"
    }
  ]
}
```

Result: A new date with hours\_to\_add added to the start\_time field
