cancel
Showing results for 
Search instead for 
Did you mean: 

Time Format in 24 hours

Former Member
0 Kudos

Hi All,

I developed a RFC & i used that model in one webdynpro. I am getting problem with time format. In Datebase it is showing 24 hours format but in webdynpro it is showing in 12 hours format. Can u let me know how to convert that 12 hrs format to 24 hours format.

Example:

In RFC : If i enter 14:00:00 it is storing as same

In webdynpro: it is storing as 2:00 PM. I want it to be displayed in webdynpro as 14:00:00.

Thanks

Venu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Venu,

Is your RFC returning back java.sql.Date (or similar)? If so you can format the date for display using SimpleDateFormat. For example:

Timestamp now = new Timestamp(System.currentTimeMillis());

SimpleDateFormat formater = new SimpleDateFormat("HH:mm:ss");

String str = formater.format(now);

System.out.println("The parsed time is " + str);

Cheers.

luciano_leitedasilva
Contributor
0 Kudos

Hi Kodalivenu,

You must to create a new data type, a simple data type built in type time, and fill its represantation format with HH:mm:ss. Create a new context attribute with this data type and set the RFC value at this attribute. Show the new attribute created at the ivew!

Regards,

Luciano