Application Development and Automation 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: 
Read only

Time format

Former Member
0 Likes
1,070

Hi,

I am getting one output from the table with date and time ex 20081210053409 (yyyymmddhrmmss). This fiemd I want to split into time with the format of HH:MM:SS.

How I do it.

Thanks

RB

1 ACCEPTED SOLUTION
Read only

former_member226519
Active Contributor
0 Likes
835

split the string into 2 variables:

gv_date type sy-datum

gv_date_txt(10).

gv_time type sy-uzeit.

gv_time_txt(8)

simply write gv_time to gv_time_txt will formate according to user settings

5 REPLIES 5
Read only

former_member226519
Active Contributor
0 Likes
836

split the string into 2 variables:

gv_date type sy-datum

gv_date_txt(10).

gv_time type sy-uzeit.

gv_time_txt(8)

simply write gv_time to gv_time_txt will formate according to user settings

Read only

0 Likes
835

Go with Volkers solution and forget about the others....

>

> split the string into 2 variables:

> gv_date type sy-datum

> gv_date_txt(10).

> gv_time type sy-uzeit.

> gv_time_txt(8)

>

> simply write gv_time to gv_time_txt will formate according to user settings

And if you don't know how to get the values:

gv_date = gv_datetime(8).

gv_time = gv_datetime+8(6).

Read only

Former Member
0 Likes
835

Hi,

You can split like

2008/12/10/05/34/09 at '/'(for example) and concatenate them accordingly to your final output field.

Thanks,

Sree.

Read only

Former Member
0 Likes
835

datetime = 20081210053409 (yyyymmddhrmmss)

CONCATENATE datetime8(2) ':' datetime10(2) ':' datetime+12(2) INTO time.

Read only

Former Member
0 Likes
835

just read the F1 Documentation on the below

CONVERT TIME STAMP time_stamp TIME ZONE tz 
        INTO [DATE dat] [TIME tim] 
        [DAYLIGHT SAVING TIME dst].

there is a sample code in it see that.