time is an in-build function of Apache JMeter and its type is ‘Information’, which returns the current date and time in various formats like epoch or human-readable time etc. By the way, JMeter in-build functions are divided into eight categories which are:
- Information
- Input
- Calculation
- Formatting
- Scripting
- Properties
- Variables
- Strings

Syntax: ${__time}
Type: Information
Purpose: To generate the current date and time in the required format.
Example: If someone wants to get the date in 10/03/2024 format then he can use ${__time(dd/MM/yyyy,)}.
Input Argument:
- Format: Refer to the below table for the input format to get the required value.
- Name of Variable: To store the generated value in a variable.
| Format | Example | Description |
|---|---|---|
| ${__time()} | 1710076012661 | Current Time in Epoch Format in milliseconds |
| ${__time(/1000)} | 1710076012 | Current Time in Epoch Format in seconds |
| ${__time(yyyy)} | 2024 | Current Year |
| ${__time(MM)} | 03 | Current Month in digit |
| ${__time(MMM)} | Mar | 3 letters of the Current Month |
| ${__time(MMMM)} | March | Full spell of Current Month |
| ${__time(LL)} | 03 | Current Month in digit |
| ${__time(LLL)} | Mar | 3 letters of the Current Month |
| ${__time(LLLL)} | March | Full spell of Current Month |
| ${__time(d)} / ${__time(dd)} | 1 / 01 or 21 / 21 | Current Day in one or two digits |
| ${__time(h)} / ${__time(hh)} | 1 / 01 or 11 / 23 | Current Hour in one or two digits in 12-hour format (1-12) |
| ${__time(H)} / ${__time(HH)} | 1 / 01 or 11 / 23 | Current Hour in one or two digits in 24-hour format (0-23) |
| ${__time(k)} / ${__time(kk)} | 1 / 01 or 11 / 23 | Current Hour in one or two digits in 24-hour format (1-24) |
| ${__time(K)} / ${__time(KK)} | 1 / 01 or 11 / 23 | Current Hour in one or two digits in 12-hour format (0-11) |
| ${__time(m)} / ${__time(mm)} | 5 / 05 or 15 / 15 | Current Minute in one or two digits |
| ${__time(s)} / ${__time(ss)} | 2 / 02 or 19 / 19 | Current Second in one or two digits |
| ${__time(S)} / ${__time(SS)} / ${__time(SSS)} | 3 / 03 / 003 or 13 / 13 / 013 or 310 / 310 / 310 | Current Millisecond in one, two or three digits |
| ${__time(A)} | 69684021 | milliseconds |
| ${__time(a)} | AM or PM | Current Meridian |
| ${__time(n)} | 432000000 | nano-of-second |
| ${__time(N)} | 70283500000000 | nano-of-day |
| ${__time(z)} | IST | Timezone in abbreviation |
| ${__time(zzzz)} | India Standard Time | Timezone |
| ${__time(Z)} | +0530 | Timezone offset in hours (RFC pattern) |
| ${__time(XXX)} | +05:30 | Timezone offset in ISO format |
| ${__time(O)} | GMT+5:30 | Localized zone-offset |
| ${__time(u)} | 2024 | Current Year |
| ${__time(E)} / ${__time(EEEE)} | Wed / Wednesday | Current Day in letters |
| ${__time(e)} / ${__time(c)} | 1 | Current Day Number (1 – Sunday, 2 – Monday, 3 – Tuesday, 4 – Wednesday, 5 – Thursday, 6 – Friday, 7 – Saturday) |
| ${__time(ee)} / ${__time(cc)} | 01 | Current Day Number (01 – Sunday, 02 – Monday, 03 – Tuesday, 04 – Wednesday, 05 – Thursday, 06 – Friday, 07 – Saturday) |
| ${__time(eee)} / ${__time(ccc)} | Sun | Current Day in 3 letters format |
| ${__time(eeee)} / ${__time(cccc)} | Sunday | Current Day |
| ${__time(F)} | 3 | Week in a month (1 – First week, 2 – Second week) |
| ${__time(D)} | 70 | Current day count in the year |
| ${__time(W)} | 3 | Week in a month (1 – First week, 2 – Second week) |
| ${__time(w)} | 11 | Week in a year |
| ${__time(G)} | AD | Current Era |
| ${__time(Q)} | 1 | Quarter of the year in one digit |
| ${__time(QQ)} | 01 | Quarter of the year in two digits |
| ${__time(QQQ)} | Q1 | Quarter of the year in alpha-numeric format |
| ${__time(QQQQ)} | 1st quarter | Quarter of the year in alpha-ordinal format |
Return Value: the function returns the number, text and symbol which are used for the format. If a variable name is provided as an argument then the return value is stored in that variable.
Example: If you use ${__time(yy-MM-dd-HH:mm:ss:SSS, cTime)} to capture the current timestamp then variable cTime will store the generated value and you can use ${cTime} wherever you want to pass the generated value.
Use: The time function has a specific use to generate the date, time and related date-time values in various formats. Although it is also used to generate the unique value with epoch format.
Related Functions:
You may be interested: