It is currently Fri Jul 30, 2010 2:10 pm


All times are UTC [ DST ]


Ask on Codemiles community and get answers Free and Fast :

JSP/Servelts codes,JSP/Servelts tricks ,JSP/Servelts faq ,JSP/Servelts answers .and more

Our guest share with us your code snippets , your programming problems , your open source projects ,read articles and post yours .







Post new topic Reply to topic  [ 3 posts ] 
  Print view Previous topic | Next topic 
Author Message
 Post 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  
 
| More
 Post 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: 1573
Location: Earth
Has thanked: 10 time
Have thanks: 16 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 .


TOP
 Profile Send private message  
 
| More
 Post 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  
 
| More
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


 Similar topics
 Topic title   Forum   Author   Replies 
 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
 Google indexing DATE  PHPbb3 support  mulkman  2
 C++ Increment Operators  C++ examples  mileloader  0
 Acquiring Date Information with getdate()  PHP Tutorials  msi_333  0

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  





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-2009
mileX v1.0 designed by codemiles team