Fetch current time in 24 hours format in JMeter

后端 未结 2 1284
小蘑菇
小蘑菇 2020-12-22 03:32

How can I get current time in 24 hours format in JMeter.

I tried ${__time(hh:mm a,)} but it results in AM/PM format.

2条回答
  •  爱一瞬间的悲伤
    2020-12-22 04:00

    As per How to Use JMeter Functions guide JMeter's __time() function output can be controlled via SimpleDateFormat class patterns.

    Looking into JavaDoc:

    • you don't need a letter
    • you need to use capital H for 0-24 hours or lowercase k for 1-23 hours

    So change function to ${__time(HH:mm,)} and that should be it

提交回复
热议问题