Solved

Date in JSP

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reading data  from excel sheet and displaying 1 74
build fail in maven project 11 179
countXY challenge 28 146
how to add new optional parameter to JSP 1 29
With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

895 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

16 Experts available now in Live!

Get 1:1 Help Now