note 69608 added to ref.datetime

From: Date: Tue, 12 Sep 2006 16:50:29 +0000
Subject: note 69608 added to ref.datetime
Groups: php.notes 
Request: Send a blank email to php-notes+get-117069@lists.php.net to get a copy of this message
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. ---- Server IP: 64.71.164.2 Probable Submitter: 147.202.23.71 ---- Manual Page -- http://www.php.net/manual/en/ref.datetime.php Edit -- https://master.php.net/note/edit/69608 Del: integrated -- https://master.php.net/note/delete/69608/integrated Del: useless -- https://master.php.net/note/delete/69608/useless Del: bad code -- https://master.php.net/note/delete/69608/bad+code Del: spam -- https://master.php.net/note/delete/69608/spam Del: non-english -- https://master.php.net/note/delete/69608/non-english Del: in docs -- https://master.php.net/note/delete/69608/in+docs Del: other reasons-- https://master.php.net/note/delete/69608 Reject -- https://master.php.net/note/reject/69608 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117069) next »