---
title: timeshifted
description: The `timeshifted` keyword modifies the timerange within the scope of the query. This is useful when, for example, a custom dashboard has a global timerange of `Today` but your query only makes sense when looking at yesterday's data.
url: https://coralogix.com/docs/dataprime/language-reference/commands-reference/sources/time/timeshifted/
product: dataengine
feature: DataPrime Language
feature_id: dataprime-language
feature_identifier: dataengine/dataprime-language
last_updated: '2026-10-21'
---

# `timeshifted`

## Description

The `timeshifted` keyword modifies the timerange within the scope of the query. This is useful when, for example, a custom dashboard has a global timerange of `Today` but your query only makes sense when looking at yesterday's data.

## Syntax

```
source (logs|spans) timeshifted <interval>
```

## Example

The `timeshifted` query is simple to employ for both `logs` and `spans`.

```
source logs timeshifted 1h

source spans timeshifted -1h
```

To provide a worked example, assume the current timerange in the Coralogix interface is set to `Last 1 Hour`, and we run the following query:

```
source spans timeshifted -1h
```

This is going to execute the query from `now - 2h` to `now - 1h`. It has shifted the entire time window back one hour.

### Try it yourself

Open up your Coralogix explore screen and paste in the following query:

```
source logs timeshifted -1d
```
