---
title: "__timeShift"
description: "JMeter __timeShift function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values."
url: https://docs.jmeter.ai/functions/timeshift/
lastUpdated: 2026-10-01
source: docs.jmeter.ai
---

# __timeShift

*Also documented in context in the [full Functions and Variables reference](/user-manual/functions/#__timeShift).*

The timeShift function returns a date in the given format with the specified amount of seconds, minutes, hours, days or months added

| Name | Required | Description |
| --- | --- | --- |
| Format | No | The format to be passed to DateTimeFormatter (for input data parsing and output formating).         See [DateTimeFormatter](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html)         If omitted, the function uses milliseconds since epoch format. |
| Date to shift | No | Indicate the date in the format set by the parameter `Format` to shift.         If omitted, the date is set to *ZonedDateTime.now* with system zone *ZoneId.systemDefault()*.          :::note If `Format` is empty then this parameter must be long value (look at examples). ::: |
| value to shift | No | Indicate the specified amount of seconds, minutes, hours or days to shift according to a textual         representation of a duration such as `PnDTnHnMn.nS`. See         [Duration#parse(CharSequence)](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-).         If ommitted, no shifting will be done.          - `PT20.345S` parses as 20.345 seconds - `PT15M` parses as 15 minutes - `PT10H` parses as 10 hours - `P2D` parses as 2 days - `-P6H3M` parses as -6 hours and -3 minutes |
| Locale to use for format | No | The string format of a locale. The language code must be lowercase. The country code must be uppercase.         The separator must be an underscore (`_`). For example `en_EN`         See [supported locales on Java 7](http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html).         If omitted, by default the function uses the current locale from the JVM. |
| Name of variable | No | The name of the variable to set. |

Examples:

```bash
\${__timeShift(dd/MM/yyyy,21/01/2018,P2D,,)}
```

returns `23/01/2018`

```bash
\${__timeShift(dd MMMM yyyy,21 février 2018,P2D,fr_FR,)}
```

returns `23 février 2018`

```bash
\${__timeShift(,10000,PT10S,,)}
```

returns `20000` = 10sec input + 10sec shift

```bash
\${__timeShift(,,PT10S,,)}
```

returns `1632158276770` = 1632158266770 ms (now) + 10sec shift

## Related

- [Functions and Variables Guide](/topics/functions-and-variables/)
- [Regex Extractor Builder](/tools/regex-tester/)
- [Full Functions Reference](/user-manual/functions/)
- [Component Reference](/user-manual/component-reference/)
