note 62375 added to function.gettimeofday

From: Date: Mon, 27 Feb 2006 10:31:21 +0000
Subject: note 62375 added to function.gettimeofday
Groups: php.notes 
Request: Send a blank email to php-notes+get-104474@lists.php.net to get a copy of this message
I was expecting gettimeofday would give me the number of seconds of the day. But if you access the "sec" index of the array it is identical to time() (so, unix timestamp, seconds since 1970). So for others have to help them quicker, to get the number of seconds of the day, try this: <?php $t = time() % 86400; ?> ---- Server IP: 217.13.201.10 Probable Submitter: 217.7.121.121 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.gettimeofday.php Edit -- http://master.php.net/note/edit/62375 Del: integrated -- http://master.php.net/note/delete/62375/integrated Del: useless -- http://master.php.net/note/delete/62375/useless Del: bad code -- http://master.php.net/note/delete/62375/bad+code Del: spam -- http://master.php.net/note/delete/62375/spam Del: non-english -- http://master.php.net/note/delete/62375/non-english Del: in docs -- http://master.php.net/note/delete/62375/in+docs Del: other reasons-- http://master.php.net/note/delete/62375 Reject -- http://master.php.net/note/reject/62375 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#104474) next »