hi i have one issue while coding the dates . i want to add
the date curret to 4 days . can any one helme plz about
this

regards
balaji

Answer Posted / kazi

Hi Bala,
this is coding---
public static void main(String args[]) throws Exception
{ SetTest st = new SetTest(); st.addDaysToDate
("28/04/2009", 4);} private void addDaysToDate(String date,
int daysToAdd) throws Exception { Date todayDate = new
Date(); DateFormat sdf = new SimpleDateFormat
("dd/MM/yyyy"); String strDate = sdf.format
(todayDate); Date parsedDate = sdf.parse(date);
System.out.println(strDate); System.out.println
(parsedDate); Calendar now = Calendar.getInstance
(); now.setTime(parsedDate); now.add
(Calendar.DAY_OF_MONTH, daysToAdd); System.out.println
(now.getTime());}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi, How Accessibility checkpoint in QTP can be implemented in the test script?

1593


How will you handle java tree in qtp?

613


How to creating an output value using quicktest professional?

525


What is expert view and keyword view?

614


How to use checkpoints in qtp ?

567






What is the limitation to XML Checkpoints?

1591


How many ways we can parameterize data in quicktest professional?

546


How many types of actions are there in quicktest professional (qtp)?

521


Difference between copy to action and call to action?

577


what testplan contents and what test strategy contents,what is the diff b/w them

1631


How many add-ins comes by default with quicktest professional?

543


Hi all, I am using windows vista, I am in the process of learning QTP. When ever I try to work with insert mode in flight application , i am getting the error of 'Operation must use an update table query, fractional truncation(null) error. Can anyone help me regarding this?

1383


hi to all, i need a code.. in flight application 1.i need to login first then i need to insert 3 new orders... 2.i have to log out 3.i have to login again with different user 4.need to insert 2 new orders 5.then need to log out 6.then again login with different user 7.3 new orders create and log out 8.but we hv to do this using data table and actions please help me

1742


Should have experience in framework means?

1404


What are the features supported by UFT?

655