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

# Select time ranges

> Use the time range selector to scope queries, charts, tables, and graphs across monitors, dashboards, service pages, and explorers.

Many features in Palo Alto Networks Cortex XCOR share a common interface and
methods for selecting a *time range*. Tools such as
[monitors](/investigate/alerts/monitors), [dashboards](/observe/dashboards), [service
pages](/observe/services/service-pages), and [explorers](/investigate) use time
ranges to segment or scope queries, charts, tables, and graphs.

In these tools, the **<Icon icon="clock" /> time range selector** displays the
defined time range and provides multiple methods to select a new time range.

Click the time range selector to select a time range in one of the following ways:

* Type a range in the search box, or set the **From** and **To** fields.
* Select a preset relative range or period, such as **Last 30 minutes** or **Yesterday**.
* Pick dates on the calendar.

Some time range selectors also provide additional controls to shift, expand, refresh,
or pin the selected time range. Next to the selected time, the time since the page
was last loaded displays if the page hasn't reloaded recently.

## Enter a time range

You can enter a time range by typing, in either of two places that accept the same
values:

* The **search box** at the top of the dropdown, where you type the whole range. A
  single value sets the start and uses the current time as the end; type
  `<start> to <end>` to set both. Press `Enter` (`Return` on macOS) to apply.
* The **From** and **To** fields, where you enter the start and end separately, then
  click **Apply time range**.

### Type a relative range

A relative range is measured backward from the current time. Enter a relative value
using Cortex XCOR [time units](/overview/concepts/time-units). The time range
selector accepts any of these formats, where `1` is the quantity and `week` and `w`
represent the time unit:

* `Last 1 week`
* `1 week`
* `1w`

A bare duration, such as `5m`, is shorthand for `now-5m`.

You can enter any integer quantity greater than zero. Relative ranges support only
millisecond and larger time units, and convert units smaller than a second to decimal
values of a second.

### Type an absolute range

An absolute range has fixed start and end timestamps. Type a timestamp using the format
`MM/DD/YYYY hh:mm:ss AM/PM`. The search box also accepts ISO 8601 timestamps. To set the
end to the current time, enter `now` in the **To** field.

### Type a current or previous range

A snapped range rounds a relative expression to a calendar boundary, so you can select a
period that's still in progress, such as **Today so far**, or a completed period, such as
**Yesterday**. Add a `/` and a time unit to the end of a relative expression to snap it.
The start rounds to the beginning of the period and the end rounds to the end of the
period, so using the same snapped expression for both covers the entire period.

Time units are case-sensitive. For example, `M` means month and `m` means minute:

| Period | Time unit |
| - | - |
| Day | `d` |
| Week | `w` |
| Month | `M` |
| Year | `y` |

For example:

* `now/d` selects **Today so far**, from the start of the current day until now.
* `now-1d/d to now-1d/d` selects **Yesterday**, the entire previous day.
* `now-1w/w to now-1w/w` selects **Previous week**, the entire previous week.

To understand how snapping resolves, suppose the current time is Wednesday, September 9 at
2:30 PM. Use `now-1d/d to now-1d/d` to select Tuesday, September 8, from 12:00:00 AM to
11:59:59 PM. Choose `now/d` to select Wednesday, September 9, from 12:00:00 AM to 2:30 PM.

You can also select these ranges from the preset list. See
[Current and previous periods](#current-and-previous-periods).

### Filter the preset list

As you type in the search box, the preset list filters to match, so you can narrow it
instead of applying a typed value.

## Select a preset range

The dropdown lists preset ranges you can select without typing.

### Relative presets

To select a predefined relative range:

1. Click the **<Icon icon="clock" /> time range selector** field as a dropdown menu.
2. Select a range in the list, such as **Last 6 hours**.

### Current and previous periods

Preset period ranges snap to a calendar boundary, so you can select a period that's still
in progress, such as **Today so far**, or a completed period, such as **Yesterday**.

To select one of these ranges:

1. Click the **<Icon icon="clock" /> time range selector** field as a dropdown menu.
2. Select a range such as **Today so far** or **Previous week** from the list.

The following preset ranges are available:

| Range | Selected period |
| - | - |
| **Today so far** | Start of the current day until now |
| **This week so far** | Start of the current week until now |
| **This month so far** | Start of the current month until now |
| **This year so far** | Start of the current year until now |
| **Yesterday** | The entire previous day |
| **Day before yesterday** | The entire day two days ago |
| **This day last week** | The entire day one week ago |
| **Previous week** | The entire previous week |
| **Previous month** | The entire previous calendar month |
| **Previous year** | The entire previous calendar year |

To type these ranges instead, see
[Type a current or previous range](#type-a-current-or-previous-range).

## Pick dates on the calendar

To select an absolute range from the calendar:

1. Click the **<Icon icon="clock" /> time range selector** field as a dropdown menu.
2. Navigate to the month of the start date. To go forward or backward one month at a
   time, click **<Icon icon="chevron-left" alt="Previous month icon" />** for the
   previous month and **<Icon icon="chevron-right" alt="Next month icon" />** for the
   next month.
3. Select the start and end dates on the calendar.
4. Optional: Enter `now` in the **To** field to set the end to the current date and
   time.
5. Click **Apply time range** to confirm the set time range.

To type an absolute timestamp instead of using the calendar, see
[Type an absolute range](#type-an-absolute-range).

## Shift a time range

To shift the defined time range forward or backward in time while retaining the same
duration, click the **<Icon icon="chevron-left" /> previous** and **<Icon icon="chevron-right" /> next time range** buttons.

Shifting a relative time range also converts it to an absolute time range.

## Expand a time range

To expand the defined time range's duration while retaining the same point in time at
the range's center, click the **<Icon icon="zoom-out" /> zoom out** button.

Expanding a relative time range also converts it to an absolute time range.

On data visualization tools, there is no control to shrink, or "zoom in," for a time
range. Instead, click and drag within a panel visualization to select a time range.

## Refresh a time range

To manually refresh the current point in time for a relative time range, or to update
a visualization's contents within an absolute time range, click the time range
selector's **<Icon icon="rotate-cw" /> Refresh** button.

On many pages, you can configure a default automatic refresh interval. For
details, see [Time ranges on dashboards](/observe/dashboards/panels#time-ranges).

## Pin a time range

You can **pin a time range** to specify a default range for a time range selector.
When you return to a feature where you've pinned a time range, that feature applies the
pinned range as the new default.

To pin a time range:

1. In the time range dropdown, click the **<Icon icon="pin" alt="Pin time range" />
   pin** icon.
2. If a relative time range is selected, select whether to pin the relative time
   range, or an absolute custom time range of the same duration that ends at the
   current time.

To unpin a time range, click the **<Icon icon="pin" iconType="solid" alt="Unpin time
range" /> pin** icon.

## Copy a time range

After selecting a time range, click the **<Icon icon="Copy" /> Copy** icon to copy
the selected range.

## Use a different time zone

To override the time zone, in the time range dropdown, select an option from the
**Page time zone** menu.

## Compare current data to past data

Comparison mode, sometimes called week-over-week view, is a Cortex XCOR
feature that overlays historical data on your current data in dashboards. This
feature provides additional context for comparing your current metrics with historical
trends and expectations, or identifying recurring trends and outliers.

To compare current data to past data:

1. Click **Compare**.
2. Select a past period to overlay onto the dashboard's panels.

   The **Preceding period** option overlays the immediately preceding period of the same
   length as the selected time range.

   An additional query runs to pull historical ("offset") time series into your graph,
   which returns data with the same resolution as your current data.

   Depending on the time period you select and your data retention settings, the
   result might include a gap for your most recent data, such as the last 10 minutes.

   Cortex XCOR matches the current and historical data queries using tag logic, with
   `_offset_:true` on the offset query and `_series_:series<num>` for all of the
   series. This associates data from the offset time series to the current series for
   similar presentation, so the results in comparison mode contain labels that
   resemble `__chrono_offset__: offset_7d1h` or `__chrono_series__: "series1"`.

To disable the overlay, click **Compare** and select **Off**.


## Related topics

- [Use notebooks to gather related information](/navigate/notebooks.md)
- [Visualize dashboard contents with panels](/observe/dashboards/panels.md)
- [Alert details](/investigate/alerts/alert-details.md)
- [Visualize values in ranges with gauge charts](/observe/dashboards/panels/gauge-chart.md)
- [Time units](/overview/concepts/time-units.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.