I am working with dates that are on an API response. Date coming from API are in EST. I need to convert the EST (technically EDT) date to UTC and then compare with dates from another API response whose values are in UTC format
I am trying to do this with Javascript in JMeter. I have a "BSF PostProcessor" as a child of my "HTTP Request" sampler.
My input: endDate=2014-01-31T23:59:59
I tried a few options but none of them get me the value I am expecting. They all come back on my debug sampler as..
myNewDate=Invalid Date
dt1=Invalid Date
vars.put("myendDate", vars.get("endDate"));
var dt = new Date('myendDate');
vars.put("dt1", dt.toUTCString());
var myDate = new Date('${endDate}');
vars.put("myNewDate", myDate.toUTCString());
var myDate = new Date('${endDate}');
myDate.toISOString();
vars.put("myDate1", myDate);
I think my BSF PostProcessor with Javascript as Language is having trouble creating the Date object.
Any inputs please?