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

Convert date time timestamp timezone

h_senden2
Active Contributor
0 Likes
807

Hi,

i have a question about an issue which is talked about a lot in this forums but i haven't found a useful answer yet. So i will ask it again.

I want to convert

given date + time + timezone (20070606 + 112530 + UTC)

into

timestamp in another timezone (for instance CET).

How can i do this ?

regards,

Hans

6 REPLIES 6
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
718

Hi,

Use this F.M..

CIF_GEN_CONVERT_TIMESTAMP

Cheers,

Simha.

reward if helpful..

Read only

h_senden2
Active Contributor
0 Likes
718

Hi,

fm CIF_GEN_CONVERT_TIMESTAMP can not be found on my system, SAP BW 3.1.

regards,

Hans

Read only

Former Member
0 Likes
718

Hi,

Look at the blog

/people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps

Regards

Sudheer

Read only

0 Likes
718

Hi Sudheer,

thanx for the useful info, but after building a test program, i have still a question :

data: l_d type d,
      l_t type t,
      l_ts type timestamp,
      l_tz type timezone value 'CET'.

start-of-selection.

l_d = '20070606'.
l_t = '112530'.
l_tz = 'CET'. " 

* convert the UTC date 20070606 time 112530 into CET
convert date l_d time l_t into time stamp l_ts time zone l_tz.

write: / l_ts.
* Result is 20070606092530
* Result is CET

Result of the program is 20070606092530,

but this is incorrect. The value should be 20070606132530

See <a href="http://www.timeanddate.com/worldclock/converted.html?day=6&month=6&year=2007&hour=11&min=25&sec=0&p1=0&p2=37">http://www.timeanddate.com/worldclock/converted.html?day=6&month=6&year=2007&hour=11&min=25&sec=0&p1=0&p2=37</a>

Any suggestions ? Or is there something wrong in my program ?

regards,

Hans

Read only

0 Likes
718

Anyone ?

Read only

0 Likes
718

No one ?