【发布时间】:2017-04-18 03:16:01
【问题描述】:
我正在尝试将 soapui 属性值(例如:2017/04/17 02:00:00)转换为毫秒。我必须以毫秒格式将明天的自定义日期时间存储到soapui属性中。到目前为止,我可以将带有自定义时间的日期存储到属性中。现在需要将其转换为毫秒。
def date = new Date();
def nextDate = date + 1
tomorrow = nextDate.format("yyyy/MM/dd");
log.info tomorrow
def setTomorrow = testCase.testSuite.project.setPropertyValue("Date", tomorrow + ' 02:00:00' );
long millisecond = setTomorrow.getTime();
log.info millisecond
错误:
无法在空对象上调用方法
getTime()
请帮忙。
【问题讨论】: