cancel
Showing results for 
Search instead for 
Did you mean: 

Date format

Former Member
0 Kudos

Hi all,

In my application i have an input field which is bind with a context element of type 'date', and right now the date date format is mm/dd/yyyy. I need to convert the format to dd.mm.yyyy. How can i do that? I tried with the Calender class but it returns as type java.util.Date..

Expecting the right ans soon, and the ans will be rewarded.

Regards

Vinod V

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

you told that you have tried calandar class and you got java.util.Date.So you convert it to java.sql.Date as

java.sql.Date sqlDate = new java.sql.Date(utlDate.getTime());

where utlDate is the java.util.date which you already have.

Regards,

Sudhir

Former Member
0 Kudos

Hi,

convert your resultant java.util.date to java.sq;.date as follows

java.sql.Date sqlDate = new java.sql.Date(utlDate.getTime());

utlDate is java.util.date

Regards,

Sudhir

Former Member
0 Kudos

hi sudhir,

I don't understand this. Please give me more idea on this...

It give s error msg when i tried the code.

regards

Vinod V

former_member182374
Active Contributor
0 Kudos

Hi,

Try to change the user language to English (United Kingdom), close the browser and open the portal again.

Regards,

Omri

Former Member
0 Kudos

I have tried by changing the lang; But it didn't got clicked; Any other way?

former_member182374
Active Contributor
0 Kudos

Hi,

What do you mean by 'didn't get clicked'.

Enter the portal as an Administrator and change the language for this user.

After, close ALL problematic browser sessions and try to login again.

The calendar should work, if it doesn't see if you get JS error when you select a day.

Omri

Former Member
0 Kudos

Vinod,

Make use of the class SimpleDateFormat Java Class. Please refer to the following thread.

Thanks!

Surya.

Former Member
0 Kudos

Hi

The SimpleDateFormat itself returns the type java.util.Date that i am not able to use in my application.

If you find other way; please let me know.

regards

Vinod V