‎2008 Sep 25 6:06 AM
hi,
i have a variable which displays the current time .
but i want the o/p time as excatly after 1hr of current time.
how to do that ...
‎2008 Sep 25 6:10 AM
Hi
try this,
u can convert all hours in minutes i.e. 1 hr = 60 min.
then add 60 min in that & again divide it by 60 u'll get ur time
‎2008 Sep 25 6:14 AM
‎2008 Sep 25 6:18 AM
Hi,
Refer the code below:
data : date type sy-uzeit.
date = sy-uzeit.
write : date.
date = date + 3600.
write : date.
Thanks,
Sriram POnna.
‎2008 Sep 25 6:24 AM
Hi,
data: time2 type SYUZEIT.
write:/ SY-UZEIT.
time2 = SY-UZEIT + 3600.
write: / time2.
Thanks,
Nelson
‎2008 Sep 25 6:37 AM
Hi,
Use the below FM ISU_DATETIME_ADD_OFFSET as it is efficient even if your date changes when adding 1 hour to time( example: if add 1 hr on 25th september 11:05 PM, then the result would be 26th september 00:05 AM)
data lv_datetime type ISU_DATETIME.
lv_datetime-date = sy-datum. " assign your date variable here
lv_datetime-time = sy-uzeit. " assign your time variable here
WRITE lv_datetime.
CALL FUNCTION 'ISU_DATETIME_ADD_OFFSET'
EXPORTING
x_datetime = lv_datetime
x_offset = '3600'
IMPORTING
Y_DATETIME = lv_datetime.
WRITE lv_datetime.
You can get the date and time from lv_datetime-date and lv_datetime-time respectively.
Regards
Karthik D