cancel
Showing results for 
Search instead for 
Did you mean: 

Java Webdynpro Date Format

Former Member
0 Kudos

Hi experts,

My webdynpro application is calling a bapi that returns a list of date related items and the problem is that the date format has been changed from dd/mm/yyyy to mm/dd/yyyy.

If i call the bapi directly from R3, the format returned is dd/mm/yyyy.

I want the date format on the webdynpro to stay as dd/mm/yyyy.

Pls help.

Thank you.

Regds,

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel

Date dateToBeChanged=<your retrived date from BAPI>;

Format formatter = new SimpleDateFormat("dd/MM/yyyy");

String tempDate = formatter.format(dateToBeChanged);

Now in tempDate you will get your desired date's format

Best Regards

Chaitanya.A

Former Member
0 Kudos

Thanks guys.

But why does web dynpro default the format to mm/dd/yyyy ?

junwu
Active Contributor
0 Kudos

Hi Daniel,

I think your date is formatted according the default locale

different locale has different display format.

John

Former Member
0 Kudos

Hi Daniel,

Go to ContrlPanel ->Regional and Language Option and change language to English UK

this will change ur date format.

Thanks

Sunitha.

Former Member
0 Kudos

Take a look at note 947081. Hope that helps you out.

https://service.sap.com/sap/support/notes/947081

Thanks,

Katan

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Poojitha!

Apparently even i had an issue with the date format and i tried your method and it worked!

Thanks!

Regards,

Janice

Former Member
0 Kudos

Sorry to misspell your name Poojith.

Thanks,

Janice

former_member185879
Active Contributor
0 Kudos

Hello Janice,

Your application is running inside portal? if yes then set the language for the portal user, the date settings will change automatically in webdynpro according to the language you are setting.

Regards

Nizamudeen SM

former_member214651
Active Contributor
0 Kudos

Hi Daniel,

1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat

2. Select the type as "date"

3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)

4.Bind the context attribute to the type created now.

Hope this helps u.

Regards,

Poojith MV

Edited by: Poojith M V on May 10, 2010 5:03 AM

Former Member
0 Kudos

Hi Daniel,

Crreate a date attribute in ur context. format the date , u r getting from the bapi using simpleDateFormatter .

regards

Sumit