# time\_add

Adds a specified amount of time to a date. Returns the result as an ISO 8601 string.

```liquid
{% assign tomorrow = "now" | time_add: 1, "days" %}
{% log tomorrow %}
```

#### Syntax

```liquid
{{ date | time_add: amount, unit }}
```

| Parameter | Description                                                                                |
| --------- | ------------------------------------------------------------------------------------------ |
| `date`    | Starting date — a date string, `"now"`, or `"today"`                                       |
| `amount`  | Number of units to add                                                                     |
| `unit`    | Time unit: `"years"`, `"months"`, `"weeks"`, `"days"`, `"hours"`, `"minutes"`, `"seconds"` |

#### Return Value

Returns a string in `YYYY-MM-DDTHH:mm:ss` format.

#### Examples

**Add days:**

```liquid
{% assign delivery_date = order.created_at | time_add: 5, "days" %}
{% log "Expected delivery: " | append: delivery_date %}
```

**Add hours from now:**

```liquid
{% assign expires_at = "now" | time_add: 24, "hours" %}
{% log "Expires at: " | append: expires_at %}
```

**Add months:**

```liquid
{% assign renewal_date = subscription.start_date | time_add: 1, "months" %}
{% log "Renewal: " | append: renewal_date %}
```

**Schedule a follow-up:**

```liquid
{% assign followup_date = order.created_at | time_add: 2, "weeks" %}
{% log "Follow-up scheduled for: " | append: followup_date %}
```

**Calculate an expiration date and format it:**

```liquid
{% assign expiry = "now" | time_add: 30, "days" %}
{% assign formatted = expiry | date: "%B %d, %Y" %}
{% log "Offer expires: " | append: formatted %}
```

Output:

```
Offer expires: March 23, 2025
```

**Combine with in\_timezone:**

```liquid
{% assign future = "now" | time_add: 3, "hours" | in_timezone: shop.timezone %}
{% log future %}
```

#### Notes

* Accepts `"now"` or `"today"` as the current date/time
* The output format is always `YYYY-MM-DDTHH:mm:ss` — use the `date` filter to reformat
* See also: `time_subtract`, `in_timezone`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datajet-app.com/liquid/filters/time_add.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
