How to calculate "time until" a certain date using PHP and the Zend Framework?

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-03-11T18:49:35Z Indexed on 2010/03/11 18:54 UTC
Read the original article Hit count: 323

Filed under:
|
|

I have two Zend Date objects to work with:

$now = Zend_Date::now();
$sessionStart = new Zend_Date('2010-04-01 10:00:00', 'yyyy-MM-dd HH:mm:ss');

I need to calculate the time remaining and display in a human readable manner.

The session will begin in 7 days.
The session will begin in 30 minutes.

How can I do this with PHP and the Zend Framework?

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework