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: 

Time Format

Former Member
0 Kudos
194

I need to change the system time to a time in Customer's time zone. The Customer's time zone can be found from TTZ5S. Is there a function module that will change to another time zone ??

2 REPLIES 2

MauricioMiao
Contributor
0 Kudos
65

Hello Reshmi,

If you are in a system greater than 4.6 you can use timestamp to do that:

DATA:

f type timestamp.

GET TIME STAMP FIELD f.

The target field f contains the global reference time UTC (Universal Time Coordination) from now, like sy-datum and sy-uzeit but in UTC. This corresponds to Greenwich Mean Time.

Then you convert to user time zone using command:

CONVERT TIME STAMP f TIME ZONE tz INTO DATE d TIME t.

In field "tz" you specify the user time zone you want.

tz must be type sy-zonlo.

Regards,

Mauricio

einar_eirksson
Explorer
0 Kudos
65

I'm not sure if there is a function that will do it but it is easy to create one. Look up CONVERT and TIMESTAMP in the ABAP help.