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

How to find the difference between 2 dates in qtp?

1044


What is the standard timing delay for web based application in qtp?

1082


Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.

2452


Explain building blocks of the bpt framework ?

1091


What the differences are and best practical application of Object Repository?

1124


How you can write contexts to text file in qtp?

1074


What is a quick test professional?

1169


What are the advantages of a Hybrid framework?

1134


What is the difference between call to existing action and copy of an action?

1093


How to add object to object repository in qtp9.0 Suppose for brower yahoo home page

1842


What are the differences between quicktest professional (qtp) and winrunner?

1053


Explain about datafile/verification of date file when file is not available in local system?

2732


What are the recording modes in wave event?

2016


Through array we can execute the testcase how ? give me example

1876


Can any one brief some detail on how the shared and action object repository utilized/implemented in a real time project. I already know how to make shared object repositor by saving OR as .tsr extension..I wanted the actual concept of implementation...couple of live examples will be highly appreciated. Thanks

2413