Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Fcommands-reference%2Fsources%2Ftime%2Ftimeshifted.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Fcommands-reference%2Fsources%2Ftime%2Ftimeshifted.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `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
```
