zoukankan      html  css  js  c++  java
  • 【Jmeter】使用 jmeter的_time函数获取时间

    1.打开jmeter,点击tools ,点击函数助手对话框

    2.选择功能,修改时间格式,点击生产

     

    3.时间格式:

    二、获取当期时间的基础上,获取这一周的开始时间和结束时间:

    开始时间:${__javaScript((new Date()).getFullYear()+'-'+ ((new Date()).getMonth()+1<10?"0"+((new Date()).getMonth()+1):((new Date()).getMonth()+1)) + '-' + (((new Date()).getDate()<10?"0"+(new Date()).getDate():(new Date()).getDate())-((new Date()).getDay()==0?7:(new Date()).getDay())+1),)}

    结束时间:${__javaScript((new Date()).getFullYear()+'-'+ ((new Date()).getMonth()+1<10?"0"+((new Date()).getMonth()+1):((new Date()).getMonth()+1)) + '-' + (((new Date()).getDate()<10?"0"+(new Date()).getDate():(new Date()).getDate())+6-((new Date()).getDay()==0?7:(new Date()).getDay())+1),)}

    三、在获取当前时间的基础上,对日期进行加减

    原文链接:https://blog.csdn.net/jocleyn/java/article/details/83414433

    2、__timeShift(格式,日期,移位,语言环境,变量)函数,可以将时间进行移位,对当前时间增加或者减少对应的时间

    (1)、格式 - 将显示创建日期的格式。如果该值未被传递,则以毫秒为单位创建日期。

    (2)、日期 - 这是日期值。用于如果要通过添加或减去特定天数,小时或分钟来创建特定日期的情况。如果参数值未通过,则使用当前日期。

    (3)、移位 - 表示要从日期参数的值中添加或减去多少天,几小时或几分钟。如果该值未被传递,则不会将任何值减去或添加到日期参数的值中。

    “P1DT2H4M5S” 解析为“添加1天2小时4分钟5秒”

    “P-6H3M”解析为“-6小时+3分钟”

    “-P6H3M”解析为“-6小时-3分钟”

    “-P-6H + 3M”解析为“+6小时和-3分钟”

    (4)、区域设置 - 设置创建日期的显示语言。不是必填项

    (5)、变量 - 创建日期的值将被分配给的变量的名称。不是必填项

     

  • 相关阅读:
    Flask——session
    UISB ScrollView
    UISB 登陆
    UISB TextField
    UISB 进步器 分栏控制器
    UISB UISlider ProgressView
    UISB Switch
    UISB 定时器
    Django-Celery文档
    UISB UIViewController
  • 原文地址:https://www.cnblogs.com/daiwl/p/11571320.html
Copyright © 2011-2022 走看看