# Using Additional Dates for Calculations

In some cases, you may include extra date values with your transactions or custom events - for example, storing the opt-in time on a member’s profile. These dates can later be used for various types of calculations and segmentation.

Below are some example expressions showing how to work with such dates. While the examples use custom attributes from transactions (`transaction.labels`), the same logic applies to attributes stored on the member’s profile (`customer.labels`).

### Checking the Month

To determine if a custom date (e.g., 'custom\_date') falls within a specific month, use:

```
month(to_date(agg(transaction.labels).getLabelValue('custom_date'))) == 'April'
```

### Checking the Day of the Week

To check if a custom date falls on a weekend (e.g. Saturday or Sunday), use:

{% code overflow="wrap" %}

```
day(to_date(agg(transaction.labels).getLabelValue('custom_date'))) in ["Saturday","Sunday"]
```

{% endcode %}

### Checking the Time of Day

To check if a custom date falls between specific hours (e.g., between 6:00 and 9:00), use:

{% code overflow="wrap" %}

```
is_time_between(to_date(agg(transaction.labels).getLabelValue('custom_date')),to_date('06:00'),to_date('09:00'))
```

{% endcode %}


---

# 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://help.openloyalty.io/main-features/expressions/sample-use-cases/additional-dates.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.
