[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Date in JSP

Posted on 2004-09-23
5
Medium Priority
?
1,095 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 300 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Have you ever run into that annoying problem where the computer won't boot?  Wouldn't it be great if you had a tool that would make that disk boot again?  I have found one tool that works more often than not ...
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

649 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