Skip to Content
avatar image
Former Member

Displaying date in dd/MM/yyyy format

Hi all,

I am having one date field .To display the date in correct format, I created a dictionary simple type of type date and entered dd/MM/yyyy in representation tab.

I was using 2004 and it was working properly. Now I am using 2004s for the same application. The problem is when I am selecting a date , it is showing the date in MM/dd/yyyy format in first time. If I selects the date again, then it will be in dd/MM/yyyy format. How can I make the selection in dd/MM/yyyy in first time itself

Thanks

Fahad Hamsa

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Oct 29, 2006 at 06:54 AM

    Hi,

    use this code

    Date date1 = new Date();

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

    String formattedDate = fmtDatePlain.format(date1);

    System.out.println("todaysdate" +formattedDate);

    thanks

    Lohi.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 30, 2006 at 03:45 AM

    Thanks Lohitha. But I didnt get the solution for my problem

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Try this:

      1. Create a simple type in the local dictionary. Call it say, CustomDateType.

      2. Set the built-in type as date.

      3. Go to the representation tab and under "External Representation" set the format to "dd/MM/yyyy".

      4. Create a context value attribute day, CustomDate and set its type to CustomDateType.

      5. Create an inputfield with id say, "DateField" and bind its value property to CustomDate.

      6. Now in your wdDoModifyView() write the following code:

      if(firstTime){
         IWDViewElement e = view.getElement("DateField");
         e.requestFocus();
      }
      

      Regards,

      Satyajit.

  • avatar image
    Former Member
    Oct 30, 2006 at 05:39 AM

    Hi satyajit,

    Thanks for the reply.I tried your solution, but not working. I found out one more thing. The problem is only for the application that is migrated from 2004 to 2004s.

    Can you please give me some other solution for this.

    Thanks

    Fahad Hamsa

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 31, 2006 at 04:27 AM

    Hi,

    The date is in dd/MM/yyyy format in local settings and selected the regional settings as English(UK).

    Thanks

    Fahad

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 31, 2006 at 06:48 AM

    Does anybody can help me.It is very urgent for me

    Thanks

    Fahad Hamsa

    Add comment
    10|10000 characters needed characters exceeded