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
What is the difference between per-action and shared?
wht type of User defined functions or Java Releated functions Do we write in VB scripting
how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?
How to call a test from another test?
Explain the parameter in qtp?
what is clean sweep?
Describe function procedure in vbscript.
how can i pass a "cript"as a parameter in to a function
By using QTP can we record any log files written by the application which is in execution?
What is checkpoints for qtp?
Give me At Least 5 Differences between DOCUMENTATION OBJECT MODEL(DOM)and COMPONENT OBJECT MODEL(COM)? Interviewer said me to WRITE the difference only in points not as you WRITE a paragraph ???? only in points
What is ObjectParamater?
What is regular expression?
What is qtp window?
How software automation specialist enter steps in the Expert View?