Total members 9936 | Gratitudes |It is currently Sun Feb 05, 2012 8:37 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 3 posts ] 
Author Question
 Question subject: How To Increment Date In JSP?
PostPosted: Tue Jun 09, 2009 4:27 pm 
Offline
Newbie
User avatar

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


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How To Increment Date In JSP?
PostPosted: Wed Jun 10, 2009 6:52 am 
Offline
Mastermind
User avatar

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

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How To Increment Date In JSP?
PostPosted: Fri Jun 12, 2009 2:54 am 
Offline
Newbie
User avatar

Joined: Tue Apr 28, 2009 10:05 am
Posts: 4
Has thanked: 0 time
Have thanks: 0 time
Thank U. I got what i needed.


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 3 posts ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 Want start and end date of a month from current date  Java  Anonymous  1
 date validation in asp  ASP/ASP.net examples  msi_333  0
 date formatting in Java  Java examples  msi_333  0
 get next date by next day  Java examples  msi_333  0
 How To Store Date Dynamically as a field in mysql using JSP  Servlets / JSP  surya  0

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team