首页 > 代码库 > RF-获取上个月份

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:

技术分享

技术分享

 

RF-获取上个月份