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
Differences between quicktest professional (qtp) and winrunner?
Generic function to search for the unique link in webtable and click on it
Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji
How many add-ins comes by default with quicktest professional?
What are the types of object repositories? Which one is you using?
I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?
How to creating an output value using quicktest professional?
How to attach a file to TD?
how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps
How to test login module with different username and password by using data driven testing in QTP?
How to create a standard checkpoint ?
In qtp, explain what is crypt object
What does mean by Scope of Automation?n How we defined it?
how to write xml output check point bu useing descriptive programing .means without useing output check point
How to capture all the data of a webtable, weblist and combolist using QTP?