在 JMeter 中以 24 小时格式获取当前时间 [英] Fetch current time in 24 hours format in JMeter
本文介绍了在 JMeter 中以 24 小时格式获取当前时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 JMeter 中以 24 小时格式获取当前时间.
我试过 ${__time(hh:mm a,)}
但结果是 AM/PM 格式.
解决方案
根据
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.
解决方案
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 lowercasek
for 1-23 hours
So change function to ${__time(HH:mm,)}
and that should be it
这篇关于在 JMeter 中以 24 小时格式获取当前时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文