note 103580 added to ref.datetime
| From: | muhammadhudotaimanatgmaildotcom at osu1 dot php dot net | Date: | Thu, 21 Apr 2011 02:39:12 +0000 |
| Subject: | note 103580 added to ref.datetime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179035@lists.php.net to get a copy of this message | ||
<?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>";
?>
----
Server IP: 69.147.83.197
Probable Submitter: 202.153.86.152
----
Manual Page -- http://www.php.net/manual/en/ref.datetime.php
Edit -- https://master.php.net/note/edit/103580
Del: integrated -- https://master.php.net/note/delete/103580/integrated
Del: useless -- https://master.php.net/note/delete/103580/useless
Del: bad code -- https://master.php.net/note/delete/103580/bad+code
Del: spam -- https://master.php.net/note/delete/103580/spam
Del: non-english -- https://master.php.net/note/delete/103580/non-english
Del: in docs -- https://master.php.net/note/delete/103580/in+docs
Del: other reasons-- https://master.php.net/note/delete/103580
Reject -- https://master.php.net/note/reject/103580
Search -- https://master.php.net/manage/user-notes.php