Calculation the appropriate Duration from Start and Due Date

Looking to add a Timeline view to an existing application and evaluating dhtmlx as a potential solution…we store start-date and due-date instead of start-date and duration…

Is there an example which coverts a start-date and due-date into the appropriate duration?

Depending on your server language, but the formula is easy as this:

Duration = 8 * getDays( due_date - start_date)