Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Differences between quicktest professional (qtp) and winrunner?

1180


Generic function to search for the unique link in webtable and click on it

3066


Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji

1394


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

957


What are the types of object repositories? Which one is you using?

1200


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

1040


How to creating an output value using quicktest professional?

1065


How to attach a file to TD?

1153


how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps

2105


How to test login module with different username and password by using data driven testing in QTP?

1161


How to create a standard checkpoint ?

1081


In qtp, explain what is crypt object

1039


What does mean by Scope of Automation?n How we defined it?

2046


how to write xml output check point bu useing descriptive programing .means without useing output check point

2133


How to capture all the data of a webtable, weblist and combolist using QTP?

3343