Search code examples
datetimejmeterjmeter-plugins

How can I get GMT timezone current time in jmeter


I want to get GMT +7 time into jmeter. I tried following but it seems not GMT.

    ${__time(dd/MM/yyyy,)}
    ${__time(hh:mm a,)}
    ${__time(dd-mmm-yyyy HHmmss)}
    ${__javaScript(new Date().getTime();)}

Solution

  • As per SimpleDateFormat class documentation

    SimpleDateFormat JMeter Timestamp

    So you can modify pattern of JMeter's __time() function according to your requirement. Examples:

    JMeter Timezone Examples

    See How to Use JMeter Functions post for more detailed information on __time() and other JMeter Functions.