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

time increase

Former Member
0 Likes
812

Hi,

in one of my select statement I say

date of creation as = sy-uzeit.

so it takes the system time, so when it takes system time I want to add 2 more houres to that time

sy-uzeit + 2 hours ,

so how can it be done.

6 REPLIES 6
Read only

Former Member
0 Likes
786

Hi,

u can simply add one to time and it will be incremented by one second.

data ztime type sy-uzeit.

ztime = sy-uzeit.

ztime = ztime + 7200.

Read only

0 Likes
786

ztime = ztime + 7200.

what does this 7200 means, is it hours or minutes or seconds.

Read only

0 Likes
786

Hi,

ztime = ztime + 7200.

what does this 7200 means, is it hours or minutes or seconds.

In this 7200 is the number of seconds in 2 hours. But it would be good if you use FM for any Date or Time Calculation.

Regards,

Lalit

Read only

Former Member
0 Likes
786

Hi,

Use FM 'C14B_ADD_TIME' for time calculation.

Regards,

Lalit

Read only

Former Member
0 Likes
786

Hi,

Before adding the value to time, we should convert it into hours. i.e., multiply the value with (60 (sec) * 60 (min) )

l_f_val = 2. ( 2 hours to be added)

l_f_val = l_f_val * 60 * 60.

result of l_f_val = 7200.

Then add the value to sy-useit value.

l_f_time = sy-uzeit.

l_f_addtime = 2.

l_f_time = l_f_time + ( l_f_addtime * 60 * 60 ).

Read only

former_member386202
Active Contributor
0 Likes
786

Hi,

USe FM DIMP_ADD_TIME

Regards,

Prashant