Calculate Hours

Hello friends

I need calculate hours, for example:

10:00:00 + 01:00:00 = 11:00:00


10:00:00 - 01:00:00 = 09:00:00

Is There something on Yii that calculate hours?

You can use the class DateTime to represent you dates/times, and then use DateTimes function diff to get a DateInterval object. This object has a function called format which can youput what you want.

I was too quick. You can use the DateTime objects function named sub and add to calculate time.

Thank you