How to create a current year to 1900 select box in JSP

hey guys,

i got one simple logic to create a current year to 1900 select box. lets go for coding.

<select>

<%    
Date dNow = new Date( );    
SimpleDateFormat = new SimpleDateFormat ("yyyy");    
String year = ft.format(dNow);    
int foo = Integer.parseInt(year);    
while(foo > 1989)
{
%>

<option value=”<%=foo%>”><%=foo%></option>

<%        
 foo--;            
}
 %>

</select>

Advertisements

3 thoughts on “How to create a current year to 1900 select box in JSP

  1. Hello, this weekend is pleasant for me, for the reason that
    this time i am reading this impressive educational article here at my
    home.

  2. Hi there to every , as I am actually eager of reading this web site’s post to be updated on a regular basis.
    It contains nice data.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s