Total members 11889 |It is currently Fri Mar 29, 2024 9:06 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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...




Author:
Newbie
User avatar Posts: 4
Have thanks: 0 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(200720); // 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 .

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

Thank U. I got what i needed.


Author:
Newbie
User avatar Posts: 4
Have thanks: 0 time
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : How To Increment Date In JSP?
 Want start and end date of a month from current date     -  
 C++ Increment Operators     -  
 Formatting a Date with date()     -  
 get next date by next day     -  
 String to sql.Date     -  
 date validation in asp     -  
 Date in Java     -  
 make class of date     -  
 Convert String to Date     -  
 date formatting in Java     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com