05-29-2006 12:09 PM
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.
05-29-2006 12:16 PM
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
05-29-2006 12:40 PM
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'.