# How to Use Relative Date

By setting default values for "Date Input" or "Date Range" parameters, you can easily set relative dates such as "today," "yesterday," and "last week" to parameters.

## Parameters That Support Relative Dates

* [Date Input](/data-exploration/parameter-overview/parameter-types.md#date-input)
* [Date Range](/data-exploration/parameter-overview/parameter-types.md#date-range)

## How to Set Relative Dates

* Click the three-dot icon in the upper right corner of the parameter input form
* Select and configure `Relative date` or `Relative date range` from the `Default value` options

## When Relative Dates Are Calculated

Relative date calculations are performed when the parameter value is changed to the default value.\
The timing when parameter values are changed to default values for each feature is shown below.

### Notebook

* When a user performs the following operations in the parameter input form:
* When `Reset parameter values to default values` is performed for the entire form
* When `Reset to default` is performed for individual parameters

{% hint style="info" %}
Since notebook parameter changes are shared with other users in real-time, changes to default values require explicit user action. Relative date calculations cannot be performed when opening a notebook.
{% endhint %}

### Public Link

Since parameters cannot be changed, the relative date feature is not available.

### Report

* Relative dates can be applied when opening a report by configuring the following settings:
* Select `Interactive report` in the `Report type`
* Select `Enable automatically run on load` and `With defalut parameter values` in the options
  * If "with default parameter values" is not enabled, parameter values will be **the values at the time the report was published**
* Operations in the parameter input form are the same as in the notebook case

{% hint style="info" %}
Report parameter changes are **not shared** with other users.
{% endhint %}

### Signed Embed

* Relative dates can be applied when opening a signed embed by configuring the following settings:
* Specify parameters as `Client-side parameters` (do not specify as `Server-side parameters`)
* In the `Client-side parameters` section of `Embed iframe` specify `Use the default value as the initial value`
  * This requires changes to the script that generates the signed embed
  * If `Use the default value as the initial value` is not enabled, parameter values will be **the values at the time the signed embed was published**
* If parameters are specified as `Server-side parameters`, the relative date feature is not available, and relative date calculation processing must be performed when specifying dates on the server side.
* Operations in the parameter input form are the same as in the notebook case
* However, if the input form is hidden, it will not be subject to default value reset processing, so relative date calculations will not be performed

{% hint style="info" %}
Signed embed parameter changes are **not shared** with other users.
{% endhint %}

## Frequently Asked Questions

### Q: What is the reference date and time for calculating relative dates?

**A:** Relative dates are calculated based on the current time in the browser. Since the timezone follows the browser settings, the calculated relative dates may differ even at the same time if the timezone is different.


---

# 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.codatum.com/data-exploration/parameter-overview/relative-date-behavior.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.
