Solved

Date in JSP

Posted on 2004-09-23
5
1,086 Views
Last Modified: 2008-03-04
I have a form with 6 values, while entering the values, I also need to add today's There is no column to enter date. How should I enter it. Do I need to use hidden field. I would appreciate if I get the code.

Thanks
0
Comment
Question by:mahender20
  • 2
5 Comments
 

Author Comment

by:mahender20
ID: 12135619
There is no text box in the form, but the database has 7 fields, while the form has 6 fields
0
 
LVL 1

Accepted Solution

by:
gagaliya earned 75 total points
ID: 12136116
<form>
.........
<%
/***********************************
search google for all the java date formats, here are some common ones
   
dd MMMMM yyyy
yyyyMMdd
dd.MM.yy
MM/dd/yy
yyyy.MM.dd G 'at' hh:mm:ss z
yyyy.MMMMM.dd GGG hh:mm aaa
***************************************/    
    String format = "MM/dd/yyyy";
    Date today = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat(format);
    String todaydate= formatter.format(today);
   %>
<input type="hidden" name="today_date" value="<%=todaydate%>" ID=Hidden1>
</form>
0
 

Author Comment

by:mahender20
ID: 12136408
Thanks
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn how the use of a bunch of disparate tools requiring a lot of manual attention led to a series of unfortunate backup events for one company.
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question