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: 

Timestamp - Date

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Praveen,

Use FM <b>HRIQ_PROC_DH_TIMESTMP_DATETIME</b>

Regards

Aneesh.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Thank you all,

I got the solution.