Hi Shaili,

Please format your date as per your requirement, pass your db date into
format(),
Then set that string into request object to print on the jsp page.

*    java.util.Date theDate = new java.util.Date; // get the date from DB
    java.text.SimpleDateFormat dateFormatter =
       new java.text.SimpleDateFormat("MM-dd-yyyy");
*
>
> * String theFormattedDate = dateFormatter.format(theDate);
> *

  *  request.setAttribute("requiredFormat",theFormattedDate );*

 Please let me know if need anything more

Thanks

Srinivas

On Wed, Nov 19, 2008 at 2:55 PM, srinivas dumpala
<[EMAIL PROTECTED]>wrote:

> Hi,
>
>
> Please check this code hope it will fix your code.
>
> java.util.Date theDate = new java.util.Date;
> java.text.SimpleDateFormat dateFormatter =
>        new java.text.SimpleDateFormat("MM-dd-yyyy");
> String theFormattedDate = dateFormatter.format(theDate);
>
>
> On Wed, Nov 19, 2008 at 10:29 AM, Sailaja K <[EMAIL PROTECTED]>wrote:
>
>> hello friends,
>>
>> I am doing a program in java faces.
>>
>> I am storing a date in database in the format '19-Nov-2008'. while
>> accessing it through jsp it is showing as 2008-11-19. I tried all local
>> computer settings to change date format but no use.
>>
>> finally I tried to convert this date format through javascript and become
>> successful a bit.
>> if I am directly displaying date in a text box using
>> textboxname.value=converted date without or outside form tag it is working
>> but not within form tag. how to do this?
>>
>> Please help me.
>>
>>
>> ------------------------------
>> Be the first one to try the new Messenger 9 Beta! Click here.
>> >>
>> <http://in.rd.yahoo.com/tagline_messenger_7/*http://in.messenger.yahoo.com/win/>
>
>
>
>
> --
> Thanks & Regards
>
> Srinivas
> (214-597-0697)
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to