note 76193 added to function.gmmktime
| From: | dim dot zol at gmail dot com | Date: | Wed, 04 Jul 2007 15:17:56 +0000 |
| Subject: | note 76193 added to function.gmmktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128225@lists.php.net to get a copy of this message | ||
Robert,
Your mismatch is due to the subtraction of date('Y'). You must do an addition instead.
<?php
echo date('Y-m-d H:i:s', time() + intval(date('Z')))."\n";
echo date('Y-m-d H:i:s', gmmktime());
?>
Returns:
2007-07-04 08:03:01
2007-07-04 08:03:01
Take a closer look at the value returned by date('Y') and you will see that anything West
of the UTC is negative; hence, it should not be added, not subtracted.
----
Server IP: 66.207.199.35
Probable Submitter: 209.71.197.194
----
Manual Page -- http://www.php.net/manual/en/function.gmmktime.php
Edit -- https://master.php.net/note/edit/76193
Del: integrated -- https://master.php.net/note/delete/76193/integrated
Del: useless -- https://master.php.net/note/delete/76193/useless
Del: bad code -- https://master.php.net/note/delete/76193/bad+code
Del: spam -- https://master.php.net/note/delete/76193/spam
Del: non-english -- https://master.php.net/note/delete/76193/non-english
Del: in docs -- https://master.php.net/note/delete/76193/in+docs
Del: other reasons-- https://master.php.net/note/delete/76193
Reject -- https://master.php.net/note/reject/76193
Search -- https://master.php.net/manage/user-notes.php