RF-获取上个月份

 验证1:

case
    ${NowDate}    set variable    20170103
    ${year}    set variable    ${NowDate[0:4]}
    ${month}    set variable    ${NowDate[4:6]}
    ${Lastmonth}    set variable if    '${${month}}'=='${1}'    12
    ...    '${${month}}'=='${12}'    11
    ...    '${${month}}'=='${11}'    10
    ...    0${${month}-1}
    ${year}    set variable if    '${${month}}'=='${1}'    ${${year}-1}    ${year}
    ${LastMonthDate}    set variable    ${year}${Lastmonth}

验证2:

验证3:

 

posted @ 2017-08-01 17:08  垄上行  阅读(300)  评论(0编辑  收藏  举报