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

Change data/time

Former Member
0 Likes
636

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
Read only

Former Member
0 Likes
595

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
Read only

Former Member
0 Likes
595

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

Read only

former_member196280
Active Contributor
0 Likes
595

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

Read only

Former Member
0 Likes
595

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

Read only

Former Member
0 Likes
596

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.