note 69608 deleted from ref.datetime by danbrown
| From: | danbrown@php.net | Date: | Wed, 20 May 2009 02:46:04 +0000 |
| Subject: | note 69608 deleted from ref.datetime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155774@lists.php.net to get a copy of this message | ||
Note Submitter: alex dot stevenson at t8design dot com
----
A few months late on this, but I just saw cepercival at thatMailThatsHot dot com 's post, and
think that it may be a bit easier to just use this as opposed to writing it by hand:
date("z:H:i:s", $endTimestamp - $startTimestamp);
Since the timestamps store seconds from the unix epoch, and the unix epoch occured at the very
beginning of a year, you can get away with this.
It gets a little trickier to place the years, but it should work fine if you subtract out the number
of years date("Y", 0) returns. This would naturally require two seperate calls to the
date function- one to find the year, and one to find the rest of the information.