note 46627 added to function.time
| From: | jonatan at jpofy dot com | Date: | Mon, 18 Oct 2004 11:25:44 +0000 |
| Subject: | note 46627 added to function.time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78717@lists.php.net to get a copy of this message | ||
I was building a system that needed the current GMT UNIX timestamp, so I made this:
function gmtime($offset=0) {
$time = time() - date("Z") + 3600*($offset+date("I"));
return $time;
}
I thought it strange that this function wasn't already written, but then, it's so simple
that it hardly needs an own function.. I added an an offset variable too since i needed it, and it
wasn't very hard to add it :)
----
Manual Page -- http://www.php.net/manual/en/function.time.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46627
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46627&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46627&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46627&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46627&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46627&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46627&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46627&report=yes
Search -- http://master.php.net/manage/user-notes.php