Joined: Tue Apr 28, 2009 10:05 am Posts: 4 Has thanked: 0 time Have thanks: 0 time
hai, I'm a beginner in jsp. I'm doing a miniproject in jsp for online film ticket reservation. In that i want to have a reservation facility for 5 days, that means an user can reserve from current date to 5 days. i get the current date displayed on a drop down list. Now i want 5 more days from current date to be displayed on the drop down list. if any one have the code/idea, plz help me....
thank u...
msi_333
Question subject: Re: How To Increment Date In JSP?
Posted: Wed Jun 10, 2009 6:52 am
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2101 Location: Earth Has thanked: 39 time Have thanks: 56 time
this is a java code ,i didn't check it on jsp .
Code:
String DATE_FORMAT = "yyyy-MM-dd"; java.text.SimpleDateFormat simpledataformat = new java.text.SimpleDateFormat(DATE_FORMAT); Calendar c1 = Calendar.getInstance(); c1.set(2007, 0 , 20); // 2007 jan 20 System.out.println("Date is : " + simpledataformat.format(c1.getTime())); c1.add(Calendar.DATE,10); System.out.println("After 10 days : " + simpledataformat.format(c1.getTime()));
it is based on the calendar class.
another solution , i think you have to do a for loop . and every time increase the day of your date by +1 .
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
surya
Question subject: Re: How To Increment Date In JSP?
Posted: Fri Jun 12, 2009 2:54 am
Joined: Tue Apr 28, 2009 10:05 am Posts: 4 Has thanked: 0 time Have thanks: 0 time