Skip to Content
author's profile photo Former Member
Former Member

Changing date format

Hi all

I am using date context variable bound with InputField to get date from user.But it is showing the date in mm/dd/yyyy format when user selects a date.I want to display it in dd/mm//yyyy format when user selects.

How can I do this

Thanks in advance

Fahad Hamsa

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 01:06 PM

    Hi,

    use this

    SimpleDateFormat fmtDatePlain = new SimpleDateFormat("dd/mm/yyyy");

    String formattedDate = fmtDatePlain.format(date);

    You get the formatted date..

    Regards

    Saravanan K

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 01:06 PM

    Hi

    try This

    SimpleDateFormat simple=new SimpleDateFormat("DD/MM/yyyy

    ");

    String newdat=simple.format(olddate);

    Kind Regards

    Mukesh

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 02:05 PM

    Hi

    do you want to set the dateformat in the portal.

    Kind Regards

    Mukesh

    Add comment
    10|10000 characters needed characters exceeded