Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3189

Re: Function Module To Change TIME STAMP from UTC to CDT

$
0
0

This works:

REPORT ztest_timestamp.

 

DATA: g_date  TYPE d,

      g_time  TYPE t,

      g_tscdt TYPE timestamp.

 

PARAMETERS: p_tsutc TYPE timestamp.

 

INITIALIZATION.

  GET TIME STAMP FIELD p_tsutc.

 

START-OF-SELECTION.

 

  CONVERT TIME STAMP p_tsutc TIME ZONE 'UTC'

          INTO DATE g_date TIME g_time.

  CONVERT DATE g_date TIME g_time DAYLIGHT SAVING TIME 'X'

          INTO TIME STAMP g_tscdt TIME ZONE 'CST'.

 

  WRITE: / p_tsutc,

        / g_tscdt.

If you really need a FM you can build it from that. If you need conversion of timestamps of type TIMESTAMPL you will need to first capture the decimal part for the seconds and then add that back after the conversion.


Viewing all articles
Browse latest Browse all 3189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>