Solved

Date in JSP

Posted on 2004-09-23
5
1,084 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now