7 января 2017 г.

cakephp frozentime diff

Cake\I18n\FrozenTime is an extension to PHP's default DateTime, so if you need to calculate difference between two dates, for example, in seconds, do this:

$entity->modified->getTimestamp() - $entity->created->getTimestamp()

Комментариев нет: