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

Date format

Former Member
0 Likes
1,038

Hi all,

I got a date which is in the format YYYY.MM.DD hh:mm:ss

I need to convert this to YYYY-MM-DD-hh.mm.ss

Please help.

thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,017

hiii

use like below code

wa_date = '2008/08/08'.

something like:

CONCATENATE wa_date0(4) '-' wa_date5(2) '-' wa_date+8(2) INTO wa_new_date.

regards

twinkal

8 REPLIES 8
Read only

Former Member
0 Likes
1,017

Hi ,

u can use keyword REPLACE.

Regards

Prabhu

Read only

peter_ruiz2
Active Contributor
0 Likes
1,017

hi,

use this.

REPLACE '.' WITH '-' INTO field.

REPLACE ':' WITH '-' INTO field.

regards,

Peter

Read only

Former Member
0 Likes
1,017

Hi!

REPLACE ALL OCCURRENCES OF '.' IN gv_string WITH '-'.

REPLACE ALL OCCURRENCES OF ':' IN gv_string WITH '.'.

Regards

Tamá

Read only

Former Member
0 Likes
1,017

HI,

YYYY.MM.DD hh:mm:ss

REPLACE ALL OCCURENCES OF '.' WITH '-' AND

':' WITH '.' IN v_date.

Read only

0 Likes
1,017

Hi,

You can use Edit mask option for WRITE statement while displaying.

-Vikas

Read only

Former Member
0 Likes
1,018

hiii

use like below code

wa_date = '2008/08/08'.

something like:

CONCATENATE wa_date0(4) '-' wa_date5(2) '-' wa_date+8(2) INTO wa_new_date.

regards

twinkal

Read only

Former Member
0 Likes
1,017

Hi,

Try this way,,,that will solve ur issue.

concatenate date '-' time into field1.

Hope it is helps,

Regards,

T.D.M.

Read only

Former Member
0 Likes
1,017

Hi,

Hi,

go through following piece of code... and do changes where required ....

data : s_date like sy-datum,

s_date1(10).

data : s_time like sy-uzeit,

s_time1(8).

data : t_stamp(14) value '20070522064742'.

s_date = t_stamp+0(8).

s_time = t_stamp+8(6).

write s_date to s_date1.

write s_time to s_time1.

concatenate s_date1 s_time1 into t_result separated by space.

i hope u will get some help fron this

Thanks & Regards

Ashu Singh