note 63711 added to function.gmdate
| From: | ttech5593 at gmail dot com | Date: | Tue, 28 Mar 2006 22:53:49 +0000 |
| Subject: | note 63711 added to function.gmdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106887@lists.php.net to get a copy of this message | ||
For me most of the examples here needed the + or - seconds to set the time zone. I wanted a faster
way to get the time zone in seconds. So I created this :
<?php
$h = "3";// Hour for time zone goes here e.g. +7 or -4, just remove the + or -
$hm = $h * 60;
$ms = $hm * 60;
$gmdate = gmdate("m/d/Y g:i:s A", time()-($ms)); // the "-" can be switched to a
plus if that's what your time zone is.
echo "Your current time now is : $gmdate . ";
?>
It works. Hope it helps.
----
Server IP: 64.71.164.2
Probable Submitter: 69.235.251.12
----
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.gmdate.php
Edit -- http://master.php.net/note/edit/63711
Del: integrated -- http://master.php.net/note/delete/63711/integrated
Del: useless -- http://master.php.net/note/delete/63711/useless
Del: bad code -- http://master.php.net/note/delete/63711/bad+code
Del: spam -- http://master.php.net/note/delete/63711/spam
Del: non-english -- http://master.php.net/note/delete/63711/non-english
Del: in docs -- http://master.php.net/note/delete/63711/in+docs
Del: other reasons-- http://master.php.net/note/delete/63711
Reject -- http://master.php.net/note/reject/63711
Search -- http://master.php.net/manage/user-notes.php