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

Converting Time format to Decimal Value

Former Member
0 Likes
4,196

Dear All,

How to convert time to decimal value for substraction of time and decimal value

for eg l_time type tims

l_dec type p.

l_diff = l_time - l_dec

Kindly let me know.

Thanks in Advacne,

Ranjan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,534

Hi,

Try like this...


 PARAMETERS : tim TYPE tims,
             y TYPE p.
DATA : t TYPE string,
       t1 TYPE string,
       t2 TYPE string,
       t3 TYPE string.

START-OF-SELECTION.

  t = tim(2).
  t  = t * 3600. " hours to second
  t1 = tim+2(2).
  t1 = t1 * 60.  " minutes to second
  t2 = tim+4(2).
  t3 = t + t1 + t2. " total time in second
  t3 = t3 - y.

Regards

Debarshi

2 REPLIES 2
Read only

Former Member
0 Likes
1,535

Hi,

Try like this...


 PARAMETERS : tim TYPE tims,
             y TYPE p.
DATA : t TYPE string,
       t1 TYPE string,
       t2 TYPE string,
       t3 TYPE string.

START-OF-SELECTION.

  t = tim(2).
  t  = t * 3600. " hours to second
  t1 = tim+2(2).
  t1 = t1 * 60.  " minutes to second
  t2 = tim+4(2).
  t3 = t + t1 + t2. " total time in second
  t3 = t3 - y.

Regards

Debarshi

Read only

Former Member
0 Likes
1,534

Hi,

Hope the following Threads will help you regarding your problem.

This thread is really very helpful.

Thanks.

Nitesh