2

I have used {__time(DD-MM-YYYY)} to save Jmeter results, results are saving successfully but date is returning like 32-03-2019, 33-03-2019, etc

Srikanth K
  • 21
  • 1

2 Answers2

0

According to docs you should use pattern for SimpleDateFormat:

D - Day in year
d - Day in month

Note also that

y - Year
Y - Week year

so you propably want to use dd-MM-yyyy

barbsan
  • 3,418
  • 11
  • 21
  • 28
0

Most probably you're going into wrong direction. If you're using this function in the Listener - you should reconsider your approach as Listeners don't add any value, listeners just consume a lot of resources and being evaluated after each sampler

You should be running your tests in command-line non-GUI mode like:

jmeter -n -t test.jmx -l result.jtl

if you need to customise the result.jtl file to add a timestamp to it - go for command-line interpreter of your operating system features.

For example on Windows it would be something like:

jmeter -n -t test.jmx -l %date:~7,2%-%date:~4,2%-%date:~10,4%-result.jtl

on Linux/Unix/MacOS (given Bash shell)

./jmeter -n -t test.jmx -l `date +%d-%m-%Y-result.jtl
Dmitri T
  • 159,985
  • 5
  • 83
  • 133