Jmeter - 获取当前日期和时间 [英] Jmeter - get current date and time

查看:65
本文介绍了Jmeter - 获取当前日期和时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取当前日期和时间作为示例日期:11/10/2014 和时间 8:30 am 或 6:00 pm,并将其作为参数传递给我的 Jmeter 测试.有人可以帮我做这个吗.

I want to get the current date and time as example date: 11/10/2014 and time 8:30 am or 6:00 pm and pass it as parameters to my Jmeter test. Can some help me do this.

推荐答案

使用 __time 功能:

  • ${__time(dd/MM/yyyy,)}

  • ${__time(dd/MM/yyyy,)}

${__time(hh:mm a,)}

${__time(hh:mm a,)}

从 JMeter 3.3 开始,有两个新函数可以让您计算时间:

Since JMeter 3.3, there are two new functions that let you compute a time:

__timeShift

  "The timeShift function returns a date in the given format with the specified amount of seconds, minutes, hours, days or months added" and 

__RandomDate

  "The RandomDate function returns a random date that lies between the given start date and end date values." 

从 JMeter 4.0 开始:

Since JMeter 4.0:

dateTimeConvert

Convert a date or time from source to target format

如果您想正确学习 jmeter,这本书籍 会帮助你.

If you're looking to learn jmeter correctly, this book will help you.

这篇关于Jmeter - 获取当前日期和时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆