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

Timestamp - Date

Former Member
0 Likes
883

Hi All,

Acc to my requirement I want to get the date(YYYY-MM-DD) from the 15 digit decimal timestamp.

Is there any FM to get the date out from the timestamp.

Thanks in Advance,

Praveen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
779

hi Praveen,

date = timestamp+0(8)
time = timestamp+8(6).

else try this way

convert time stamp wa_rseqdone_ts
time zone sy-zonlo
into date wa_ts_date
time wa_ts_time.

check this link for full details

http://www.bwexpertonline.com/downloads/DBConnectMakingDELTAABAPCode.doc

Regards,

Santosh

5 REPLIES 5
Read only

Former Member
0 Likes
779

Hi

do the offsetting of that timestamp field and take the 8 char date field

or by offsetting separate the YYYY, MM and DD fields and concatenate them again

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
779

Hi Praveen,

Use FM <b>HRIQ_PROC_DH_TIMESTMP_DATETIME</b>

Regards

Aneesh.

Read only

Former Member
0 Likes
779

Hi,

You can use the syntax

CONVERT TIME STAMP tst TIME ZONE tz INTO DATE d TIME t.


DATA: 
  tstamp  TYPE timestamp, 
  d       TYPE D VALUE '19971224', 

  t       TYPE T VALUE '235500'. 

SET COUNTRY 'US'. 


CONVERT DATE d TIME t INTO 
        TIME STAMP tstamp TIME ZONE 'UTC+12'. 

                        " tstamp :    19971224115500 
                        "          (12/24/1997 11:55:00) 

CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO 
        DATE d TIME t. 

WRITE: (10) d,      " 12/24/1997 
    /, (8)  t.      " 23:55:00

Thanks

Naren

Read only

Former Member
0 Likes
780

hi Praveen,

date = timestamp+0(8)
time = timestamp+8(6).

else try this way

convert time stamp wa_rseqdone_ts
time zone sy-zonlo
into date wa_ts_date
time wa_ts_time.

check this link for full details

http://www.bwexpertonline.com/downloads/DBConnectMakingDELTAABAPCode.doc

Regards,

Santosh

Read only

0 Likes
779

Thank you all,

I got the solution.