note 107229 added to function.date

From: Date: Wed, 18 Jan 2012 19:02:48 +0000
Subject: note 107229 added to function.date
Groups: php.notes php.notes 
Request: Send a blank email to php-notes+get-185695@lists.php.net to get a copy of this message
add or minus the values that differ from the current php time.the example below makes my php time equals to my system/local time. <?php //my system/local/real current time is 23:50:00 //echo date('H:i:s');and php current time its 19:49:00 //so i added 4 HOURS,1 MINUTE function currentTimeofMine(){ //current php hour (24hrs format with leading 0) $c_h=date('H'); //current php minute (with leading 0) $c_i=date('i'); //current php second $c_s=date('s'); //added 4 hrs $h=$c_h+4; //added 1 mins $m=$c_i+1; //added 5 secs $s=$c_s+5; return $h.':'.$m.':'.$s; } echo date('H:i:s'); //this will echo '19:49:00' echo currentTimeofMine(); //this will echo '23:50:00' ?> ---- Server IP: 69.147.83.197 Probable Submitter: 202.153.80.140 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/107229 Del: integrated -- https://master.php.net/note/delete/107229/integrated Del: useless -- https://master.php.net/note/delete/107229/useless Del: bad code -- https://master.php.net/note/delete/107229/bad+code Del: spam -- https://master.php.net/note/delete/107229/spam Del: non-english -- https://master.php.net/note/delete/107229/non-english Del: in docs -- https://master.php.net/note/delete/107229/in+docs Del: other reasons-- https://master.php.net/note/delete/107229 Reject -- https://master.php.net/note/reject/107229 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185695) next »