Forum Discussion
smartTest
15 years agoContributor
Thanks the the updates - i've been using the following now as a way of adding times in case anyone else is interested:
def long oneDay = (long) 1000.0 * 60 * 60 * 24;
def long oneWeek = (long) 1000.0 * 60 * 60 * 24 * 7;
def long twoWeek = (long) 1000.0 * 60 * 60 * 24 * 14;
testRunner.testCase.setPropertyValue("TODAY", new Date(System.currentTimeMillis()+oneDay).format("yyyy-MM-dd"));
testRunner.testCase.setPropertyValue("DepDateTime", new Date(System.currentTimeMillis()+twoWeek).format("yyyy-MM-dd'T'00:00:00"));
This has been working well and allows me to use a property transfer to get a particular date added into a request message.
Does anyone know how to handle making these specific dates? i.e. If I wanted the date to always be the next Sunday in the calendar. As I said before, really new to scripting so any help is good help!

def long oneDay = (long) 1000.0 * 60 * 60 * 24;
def long oneWeek = (long) 1000.0 * 60 * 60 * 24 * 7;
def long twoWeek = (long) 1000.0 * 60 * 60 * 24 * 14;
testRunner.testCase.setPropertyValue("TODAY", new Date(System.currentTimeMillis()+oneDay).format("yyyy-MM-dd"));
testRunner.testCase.setPropertyValue("DepDateTime", new Date(System.currentTimeMillis()+twoWeek).format("yyyy-MM-dd'T'00:00:00"));
This has been working well and allows me to use a property transfer to get a particular date added into a request message.
Does anyone know how to handle making these specific dates? i.e. If I wanted the date to always be the next Sunday in the calendar. As I said before, really new to scripting so any help is good help!
