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

Fetch Local Time

Former Member
0 Likes
943

Hi,

I need to print the date and time of the region from where the user fires a print.The server is in Tempe and hence it shows Tempe time..but i need to display France time if the user that fires a print is in France..sy-datum will fetch the server time..is there anyway to fetch the region based time?

Thanks..

6 REPLIES 6
Read only

Former Member
0 Likes
762

See an excerpt from the docu:

<i><b>Variant 1

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

Effect

Converts time stamp tst to date d and time t for time zone tz. You can omit the additions DATE d or TIME t.

Variant 2

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

Effect

Converts date d and time t from time zone tz to time stamp tst. You can omit the TIME t addition. In this case, the system uses the initial value '000000' for the time. It then converts the value.</b></i>

Read only

Former Member
0 Likes
762

try these FM

CO_R0_SET_LOCAL_DATE_AND_TIME

S_DB_INFORMIX_UTC_TO_LOCALTIME

DB_LOCAL_TIME

Regards,

Bikash

Read only

0 Likes
762

HI

This worked for me

our server was in Europre & site is in singapore . check TTZZ for your zone in comprison with UTC...this will work

DATA: L_time_stamp TYPE timestamp,

L_dat TYPE d,

L_tim TYPE t,

L_tz TYPE ttzz-tzone.

L_tz = 'UTC+6'.

L_dat = sy-datum.

L_tim = sy-uzeit.

CONVERT DATE L_dat TIME L_tim

INTO TIME STAMP L_time_stamp TIME ZONE L_tz.

L_tz = 'UTC'.

CONVERT TIME STAMP L_time_stamp TIME ZONE L_tz

INTO DATE G_DATE1 TIME G_TIME1.

Read only

Former Member
0 Likes
762

Hi,

For local date You can use the system variable sy-datlo.

For local time you can use sy-timlo

Message was edited by:

Avanish Joshi

Read only

Former Member
0 Likes
762

Hi Rakesh,

Use SY-TIMLO also refer SYST table , But keep in mind that you can't print some one's local time , if you use this - the one who is printing his\her local time will be printed \ displayed.

Regards,

Sen

Read only

Former Member
0 Likes
762

Hi

First use this FM to get the user time zone

TZON_GET_USER_TIMEZONE

then use the time zone got from the above FM to convert user time

ISU_DATE_TIME_CONVERT_TIMEZONE

Import parameters Value

X_DATE_UTC 24.07.2007

X_TIME_UTC 01:00:00

X_TIMEZONE INDIA

Export parameters Value

Y_DATE_LCL 24.07.2007

Y_TIME_LCL 06:30:00

regards

Shiva