note 103580 deleted from ref.datetime by danbrown

From: Date: Thu, 21 Apr 2011 16:01:12 +0000
Subject: note 103580 deleted from ref.datetime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-179048@lists.php.net to get a copy of this message
Note Submitter: muhammadhu dot aiman at gmail dot com ---- <?php //hope this method is good when you see your area/country's time zone is not considered as so important,but when you are to store your local time. //example,php date shows 9:18 pm as current time.but you found that its 7:18am on your area. //so to get our real time we should add 10 hour. $time_differnce=10*60*60; //hr*min*sec $phour=time()+($time_differnce); //add 10 hours to time $nowdate=date('F j, Y'); //date now $otime=date('g:i a'); //original time that php shows $ptime=date('g:i a',$phour); //original time plus 10 hours echo "today is : ".$nowdate ."<br>"; echo "now its : ".$otime ."<br>"; echo "after 10 hours it will be ". $ptime."<hr>"; ?>

« previous php.notes (#179048) next »