Link to home
Start Free TrialLog in
Avatar of Richard Winnick
Richard Winnick

asked on

Divide duration in seconds by 30 second increments keeping track of increments and adding 1 for remainder less than 30

HI -

I have a feeling that this should be very straight forward for someone who know what they're doing - but am very new to PHP and -

Been trying to figure out how to make this work - can get pieces but don't seem to be able to put the whole thing together - Can get the subtraction working but having a terrible time keeping track of the increments and handling the remainer -

The problem is as follows:

I have a field that contains the length of a phone call in seconds -
I need to divide this total duration into 30 second increments keeping track of how many increments and adding one additional increment for any remainder less than 30 seconds -

In other words if the duration is 63 seconds I somehow need to come up with 3 increments - 30+30+3

Any help gratefully appreciated -

Richard
ASKER CERTIFIED SOLUTION
Avatar of tdterry
tdterry
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Winnick
Richard Winnick

ASKER

Hi Everyone -
This really helps -
All answers really help me understand what's going on and give me something to think about -
Split points by order of answer -
Hope this is OK -
Still new to using EE -
Thanks again -
Richard