Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Time conversion from 24hr format to 12hr format

Former Member
0 Kudos

Hi,

Do any one come across a function module which takes system time as input and outputs time in 12 hr format.

example input = 13

output = 1 pm

Early response is appreciated.

4 REPLIES 4

FredericGirod
Active Contributor
0 Kudos

Hi Syed,

Why do you need a function to make that ?

if w_date gt 12.
  w_date2 = w_date - 12.
  w_type  = 'pm'.
else
  w_date2 = w_date.
  w_type  = 'am'.
endif.

Rgd

Frédéric

0 Kudos

i have implemented the one you suggested.

but i want to know the function module if any.

former_member188685
Active Contributor
0 Kudos

Hi Use this FM

HRVE_CONVERT_TIME

in that you need to specify

TYPE_TIME 'A'

INPUT TIME

INPUT_AM_PM 'AM' or 'PM'

Try

Vijay

former_member188685
Active Contributor
0 Kudos

Hi Syed,

TYPE_TIME A

INPUT_TIME 13:00:00

INPUT_AM_PM AM

Export parameters Value

OUTPUT_TIME 01:00:00

OUTPUT_AM_PM PM

Regards

vijay