Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difficulty displaying date as dd-MM-yyyy in jsp using jdeveloper [SOLVED]

592035Aug 21 2007 — edited Aug 28 2007

Hi there,

I have searched through these forums and can't find anyone with the same problem as I am having (probably because I'm just being really dumb).

All I want to do is generate today's date and use this value in a html:text box on a .jsp page.

I can get the date in the form of: Tue Aug 21 15:50:47 BST 2007 by using

 <% String currdate = new java.util.Date().toString();%> 

But I can't change the date format to just display 21-08-2007.

I know this is going to be something completely simple but I am really new to this and struggling hard.

I have tried:

 <% String currdate = new java.text.SimpleDateFormat("ddMMyyyy").toString(); %> 

but this just returns: java.text.SimpleDateFormat@c5bfbc60.

Many thanks for taking your time to read this I hope you can help me.

Ben Sayers

Message was edited by:
BenSayers

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2007
Added on Aug 21 2007
2 comments
727 views