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: 

Change data/time

Former Member
0 Kudos

Hi All,

I want a FM which will convert the date for example 20070823101010 format to 23.08.2007 10:10:10 format. Please help.

Regards,

Jeetu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI, U can Use convert statement to do this one.

EX:CONVERT TIME STAMP <time stamp>

TIME ZONE 'UTC' INTO DATE <date type variable>

Thanks,CSR.

4 REPLIES 4

Former Member
0 Kudos

Hi,

For that use this code.

w_date = '20070823101010'

dat1 = w_date+0(8).

tim1 = w_date+8(6).

then u can use edit mask to print your time and date at apropriate format.

Like

write:/ dat1 -editmask dd.mm.yyyy.

RewaRDS POINTS IF IT IS USEFUL

former_member196280
Active Contributor
0 Kudos

Easy way to do like this

Data: date(10),

time(8),

value(14).

value = '20070823101010'.

date0(2) = value6(2).

date+2(1) = '.' .

date3(2) = value4(2).

date+5(2) = '.'.

date7(4) = value0(4).

Time0(2) = value8(2).

time+2(1) = ':'.

time3(2) = value10(2).

time+5(1) = ':'.

time6(2) = value12(2).

Regards,

SaiRam

Former Member
0 Kudos

Hi Jeetu,

I've got an FM for you, please try using this,

<b>G_BIW_CONVERT_FROM_TIMESTAMP</b>

I've tried that for your example data and it is working fine.

<b>Reward points if this helps,</b>

Kiran

Former Member
0 Kudos

HI, U can Use convert statement to do this one.

EX:CONVERT TIME STAMP <time stamp>

TIME ZONE 'UTC' INTO DATE <date type variable>

Thanks,CSR.