Updated duration function
Merge pull request #576 from phpcentre/develop

Updated duration function