java - Rally Rest Test Case creation Current Date/Time -


i using rally test case result creation code created nickm (located @ https://raw.githubusercontent.com/nmusaelian-rally/rally-java-rest-apps/master/addtcrtotc.java). question concerning date.

newtestcaseresult.addproperty("date", "2014-04-09t18:00:00.000z"); 

is there way update java code have automatically select current date/time (that script run) rather having fixed value there? in advance.

there different ways in java. need current date/time , iso format. 1 way:

you may import:

import java.util.date; import java.text.dateformat; import java.text.simpledateformat; 

and then:

date d = new date(); dateformat iso = new simpledateformat("yyyy-mm-dd't'hh:mmz");  newtestcaseresult.addproperty("date", iso.format(d)); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -