Forum Discussion
HaedenH
15 years agoOccasional Contributor
Hello,
Thanks for posting the above code segments, I am currently using the following in my SoapUI Test Case to pull information from the server based on the current date/time:
And for the most part, this works. However, the server is set to UTC where as the query defaults to EST time. So this query actually returns 5 hours worth of data. Ideally, I would like to set it so that the query only returns about 5 minutes worth of data, and also accounts for the 5 hour difference.
I was able to throw together the following Java code to handle the hour and minute changes I desire
which outputs the date/time as follows:
Date = Thu Feb 03 09:39:17 EST 2011
Calendar = Thu Feb 03 14:34:17 EST 2011
What I would like to know is if there is a way to incorporate this functionality into my soap statement? I'm new to programming in Soap, and I initially thought I could declare a variable for such a thing, but a quick Google search suggests that variables can't be directly declared in a Soap script? Can anyone offer any insight?
Thanks in advance,
HaedenH
Thanks for posting the above code segments, I am currently using the following in my SoapUI Test Case to pull information from the server based on the current date/time:
${=new java.text.SimpleDateFormat("CCyyMMDDHHmm").format(new java.util.Date())}
And for the most part, this works. However, the server is set to UTC where as the query defaults to EST time. So this query actually returns 5 hours worth of data. Ideally, I would like to set it so that the query only returns about 5 minutes worth of data, and also accounts for the 5 hour difference.
I was able to throw together the following Java code to handle the hour and minute changes I desire
public static void main(String[] args) {
Date date = new Date();
Calendar cal = (Calendar.getInstance());
cal.add(Calendar.HOUR_OF_DAY, 5);
cal.add(Calendar.MINUTE, -5);
System.out.println("Date = " + date);
System.out.println("Calendar = " + cal.getTime());
}
which outputs the date/time as follows:
Date = Thu Feb 03 09:39:17 EST 2011
Calendar = Thu Feb 03 14:34:17 EST 2011
What I would like to know is if there is a way to incorporate this functionality into my soap statement? I'm new to programming in Soap, and I initially thought I could declare a variable for such a thing, but a quick Google search suggests that variables can't be directly declared in a Soap script? Can anyone offer any insight?
Thanks in advance,
HaedenH