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: 

How to convert UTC time stamp to PST time stamp

Former Member
0 Kudos

Hi Folks,

Can you please let me know how to convert UTC date&time To PST Date&Time, any function module or any?

Thanks in Advance,

Regards,

Lakshmi.

2 REPLIES 2

Former Member
0 Kudos

Hii

chk this func modules

<b>TZON_CHECK_TIMEZONE

TZON_GET_TIMEZONE_TEXT

TZON_GET_USER_TIMEZONE

TZ_LOCATION_TIMEZONE</b>

REPORT Z_TIMESTAMP .

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.

chk this documentation

CONVERT - Converting Timestamps

CONVERT - Converting Timestamps

Variants:

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

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

Effect Converts the timestamp tst into date d or

time t based on the time zone tz.

tst must have the type P(8) (short form) or P(11) with 7 decimal places (long form). tz must have the type C(6). The ABAP Dictionary contains the data elements TIMESTAMP,TIMESTAMPL, and TIMEZONE, which you can use in DATA ... TYPE ... statements to declare tst and tz. There are no strict type checks for the date d or time t. If you specify a variable that does not have type T, the system uses the type conversion rules applied in the MOVE statement.

Regards

Naresh

former_member927251
Active Contributor
0 Kudos

Refer the code below and reward points if it helps.

 DATA:
    tstamp1       TYPE timestamp,
    tstamp2       TYPE timestamp,
    d            TYPE d,
    t            TYPE t.


* convert the sy-uzeit timestamp into its data and time components
  CONVERT TIME STAMP tstamp TIME ZONE 'UTC' INTO
          DATE d TIME t.

* convert the data and time components into a PST timestamp
  CONVERT DATE d TIME t INTO
          TIME STAMP tstamp2 TIME ZONE 'PST'.