January 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()

No comments: