cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Dates as MM.DD.YYYY instead of MM/DD/YYYY

Former Member
0 Kudos

Hi Gurus,

We know Java Web Dynpro displays the date in format of MM/DD/YYYY, however in R/3, ABAP Web Dynpro and BSP the format is MM.DD.YYYY.

We need to synchronise the date in Java WD to MM.DD.YYYY.

Any gurus know how to do it? Is there a setting that can be tweaked either in portal or the WD application itself?

Tried searching the forum with no useful results.

Thank you..

Regards,

Jansen

Edited by: Jansen Low on May 25, 2009 8:49 AM

Accepted Solutions (1)

Accepted Solutions (1)

pravesh_verma
Active Contributor
0 Kudos

Hi Jansen,

Please try this.

1) Create a simple type of type date using the dictionary types.

2) Go to the represenation tab and specify the required format may be (yyyy-MM-dd) OR (yyyymmdd).

3) Create a context attribute with datatype as the simple type which you have created.

Now you can use these attribute for your processing. By following this, you need not have to change anything in the code.

I hope this solves your issue. Please revert back in case you require any further information on this. Also You can use the date formatter for this kind of changes in the date formatting option. Please refer to this link as well:

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/using%252bdate-time%252bformats

Thanks and Regards,

Pravesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

I'm not talking about switching from Month,Day,Year format to Day,Month,Year format.

I want to change the "/" to "." to follow R/3

Former Member
0 Kudos

Thanks for the suggestion. But these are done on the WD application level. FOr our case we are doing enhancements of standard WD code.

Want to check if portal itself has any config/setting to default/change the date format.

Thanks.

pravesh_verma
Active Contributor
0 Kudos

Hi Jansen,

Can you try with this:

There are 2 ways to change date format, one from portal and other one from internet browser.

1) Goto UserAdministration - select user and modify User language to English UK

2) Goto Control Panel - Regional and Language Options and Change Language to English UK.

Try with other lanugae option and check in which language you can get it in desired format. Apart from that I think there is no other option to fulfil this requirement.

You can also try fix this from backend when you are providing the date, provide in the desired format. However this wil require code change from backend which I think you are not intended to do.

I hope that helps!

Thanks and Regards

Pravesh

Former Member
0 Kudos

Hi,

You can do that in this way

Date date1 = new Date("02-24-2009");
	DateFormat df = new SimpleDateFormat("dd/mm/yyyy");
	String date2 = date1.toString();
		Date today = df.parse(date2);

Regards,

H.V.Swathi

Edited by: H.V Swathi on May 25, 2009 9:02 AM