cancel
Showing results for 
Search instead for 
Did you mean: 

date format

Former Member
0 Kudos

Hi All

Scenario 1: I have a input field whose source i have linked to a context attibiute(say x ) of type Date. So i get a Date picker on my screen during runtime and when i choose the date it is displayed in "MM/dd/yyyy" format.

Question 1: Why does date is displayed by default in "MM/dd/yyyy" format and how can i change it ?

Scenario 2 : Client wants the date to be displayed in "dd/MM/yyyy" format .

Question 2 : I created a simple type "date_app" in which i had put dd/MM/yyyy in the format field of the representation tab.

Then i attached this simple type to the context attribute ( x , as above ) . So at runtime when i choose the date it comes as dd/MM/yyyy format .

This works fine in IE 6.0 but give problem in Mozilla firefox. In Mozilla it still displays as "MM/dd/yyyy".

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

i too face the same problem, that time i created one simple method which satisfy my requirement, hope this may usefull for you too...

public String format_Date(String DATE) {
// TODO : Implement
String Result = "";
try {
    String Month = null;
    StringTokenizer Date_Token = new StringTokenizer(DATE, "-");
int year = Integer.parseInt(Date_Token.nextToken());
int month = Integer.parseInt(Date_Token.nextToken());
int date = Integer.parseInt(Date_Token.nextToken());
switch (month) {
case 1 :
	Month = "JAN";
	break;
case 2 :
               Month = "FEB";
	break;

case 3 :





case 12 :
	Month = "DEC";
	break;
}
Result = "" + date + "-" + Month + "-" + "" + year;
} catch (Exception e) {}
return Result;
}

Former Member
0 Kudos

Hi purav,

you can change it in two ways,

(1) Change the language settings to UK English in both IE and Mozilla fire fox.

That changes the date format.

(2) You can use the method SimpleDateFormat() to change the date format temporoly. But once you choose another date; default format comes.

Regards

- Vinod

*

Former Member
0 Kudos

Hi ,

You Can use any of these three for Date Format.

first 2 will work for a particular desktop and explorer , 3rd option is a generic one .

1) go to controlpanel ->regional and language settings

chage language to English UK.

log off n login again ill change date formatto dd/mm/yyyy

2)go to Tools->Internert option->Languages->add Language English Uk and move it upwards.

3)In User administration chnage language of the user to English Uk

log off n login again ill change date format to dd/mm/yyyy

Thanks,

Sunitha Hari.

Former Member
0 Kudos

sorry, wornf post

regards,

pinki

Edited by: pinki goswami on Mar 26, 2008 5:32 AM

Former Member
0 Kudos

Hi Sunitha

If the user is authenticated and has already a language chosen in UME (say English or Korean) then the points 1 & 2 will not work since the browser gives preference for User language in UME first.

In IE 6.0 i can override this constraint by setting a context attribute of simple type where in the representation tab , i have "dd/MM/yyyy" in the format field .

But the same does not have any effect on Mozilla firefox and it behaves by taking the format from the language of the user in UME.