# YEARS\_AGO

### Description

`YEARS_AGO` functions to calculate the number of years it has been since a specific date. The date can be either given as an information or a text in [ISO8601 format](/rule-language/operators/date-operators.md#iso8601-format).

### Example

If your organisation only offers services to people over the age of 18, you can attach the following condition to a [process rule](broken://pages/-MLCQQUjwgNG2Vd_Onez):

```
p is Person
YEARS_AGO(p.date_of_birth) < 18
```

If today is 11 November, 2020, and the person who is applying for a service was born on 15 November, 2002, the process rule will raise an issue.

If that same person returns on 15 November, 2020, the condition evaluates to True, so the case can continue without issues.


---

# 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.atfinity.io/rule-language/operators/date-operators/years-ago.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.
