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

Help needed in convert timezone statement

kiruthika_raghunathan
Product and Topic Expert
Product and Topic Expert
0 Likes
2,144

Hi all,

convert date date1 time time1 into time stamp tstamp1 time zone sy-zonlo.

date1 - "99991231"

time1 - "235959"

Sy-zonlo - EST

data: date1 type datum.

data: time1 type uzeit.

data: tstamp1 type tzntstmps.

The above statement with the values mentioned in here results into a value "0".

Could any one help with this??

Regards,

Kiruthika

Edited by: Kiruthika Raghunathan on Feb 22, 2010 1:15 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,780

Hello,

date1 - "99991231"
time1 - "235959"

Sy-zonlo - EST

data: date1 type datum.
data: time1 type uzeit.
data: tstamp1 type tzntstmps.
" IF this doesnt allow concateation then take String type variable and then Concatenate
Concatenate date1 time1 into tstamp1 " this will give you time stamp value

Cheerz

Ram

9 REPLIES 9
Read only

Former Member
0 Likes
1,781

Hello,

date1 - "99991231"
time1 - "235959"

Sy-zonlo - EST

data: date1 type datum.
data: time1 type uzeit.
data: tstamp1 type tzntstmps.
" IF this doesnt allow concateation then take String type variable and then Concatenate
Concatenate date1 time1 into tstamp1 " this will give you time stamp value

Cheerz

Ram

Read only

0 Likes
1,780

Hello Ram,

I want to do some conversion based on the Timezone and i will have different values of date and time. Only for this convertion the result is Zero.

Regards,

Kiruthika

Read only

0 Likes
1,780

Hi,

Use the below FM.

data: date1 type datum.
data: time1 type uzeit.
data: tstamp1 type tzntstmps.

DATe1 = '99991231'. (pass in quotes)
time1 = '235959'. (pass in quotes)

CALL FUNCTION 'CONVERT_INTO_TIMESTAMP'
  EXPORTING
    i_datlo     = date1
    i_timlo     = time1
    i_tzone     = 'EST'
  IMPORTING
    e_timestamp = tstamp1.

It works as per your requirement.

Regards,

Ganga

Read only

0 Likes
1,780

Hi Ganga,

Thanks a lot and this solved my problem.

Regards,

Kiruthika

Read only

0 Likes
1,780

Hey,

I ma facinf the problem with same in timezone.

Can you clear me :

we are saving the data ,time,timezone in a data base table.If I want to see the record for that particuler when the USA daylight saving want to display the daylight saving USA timezone right?

FOr that can you let me know any methods or Function modules are there to convert using the date,time,timezone to daylight saving time zone.

I have to use this beofre displaying the screen.

Please let me know.

Thanks

Rmakumar

Read only

Former Member
0 Likes
1,780

That is because your Timezone is incorrect in the convert statement. Timezone should be a part of TTZZ table and field as TZONE.

You can check the TTZZ table and change your code as shown below.

data: date1 type datum.

data: time1 type uzeit.

data: tstamp1 type tzntstmps.

data: tz type ttzz-tzone.

date1 = '20101231'.

time1 = '210000'.

tz = 'IRAQ'.

convert date date1 time time1 into time stamp tstamp1 time zone tz.

write: tstamp1.

Read only

Former Member
0 Likes
1,780

Hi,

Test the following code.It is not giving zeros.You need not pass time zone is EST.You just remove that assignment you can get the coreect result.

data: date1 type datum.

data: time1 type uzeit.

data: tstamp1 type tzntstmps,tz type ttzz-tzone.

date1 = '99991231'.

time1 = '235959'.

convert date date1 time time1 into time stamp tstamp1 time zone tz.

write:tstamp1.

Thanks.

Ramya.

Read only

0 Likes
1,780

For EST time zone,System by default takes EST only.But,For other time zones you have to pass the timezone.

Read only

Former Member
0 Likes
1,780

Hi,

Try with this FM HRIQ_PROC_DH_DATETIME_TIMESTMP.

Thanks,

Suman