#22163 [Bgs]: mktime returns -3662
| From: | derick@php.net | Date: | Sun, 18 May 2003 08:08:39 +0000 |
| Subject: | #22163 [Bgs]: mktime returns -3662 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39865@lists.php.net to get a copy of this message | ||
ID: 22163
Updated by: derick@php.net
Reported By: andrew at strawberry-world dot com
Status: Bogus
Bug Type: Date/time related
Operating System: MacOS X 10.2
PHP Version: 4.3.0
New Comment:
I can not reproduce this on MacOSX, it works fine for me (with both
4.3.0 and 5.0.0-dev):
bash-2.05a$ sapi/cli/php ~/22163.php
1049000400<br>23:59:59 29-Mar = 1049000399;
01:01:03 30-Mar = 1049004063bash-2.05a
$ uname -a
Darwin iMac.local. 6.6 Darwin Kernel Version 6.6: Thu May 1 21:48:54
PDT 2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC Power Macintosh
powerpc
Previous Comments:
------------------------------------------------------------------------
[2003-05-17 04:44:23] jim at babylamb dot com
I also get this bug on Mac OS X. I don't know how you can say it is
bogus. OK, the time 0:0:0 on 30 Mar 03 doesn't exist. So why does it
make sense to return -3662? If the input is invalid, mktime should
return 0 or NULL surely? Anyway this weird behaviour should be
documented.
------------------------------------------------------------------------
[2003-03-30 14:55:46] ma499 at doc dot ic dot ac dot uk
I'm having similar problems with PHP 4.3.1 on FreeBSD 5.0-p6.
So, it is unlikely to be Mac OS X -specific (but may be xBSD specific).
------------------------------------------------------------------------
[2003-02-13 02:48:59] andrew at strawberry-world dot com
Thanks for the feedback. Will continue using mktime() at a time other
than midnight.
------------------------------------------------------------------------
[2003-02-12 13:12:57] sniper@php.net
It's MacosX specific and not PHP bug.
And you're better off when you don't use midnight for
time anyway..
------------------------------------------------------------------------
[2003-02-12 10:08:28] andrew at strawberry-world dot com
Ok, yes that sounds reasonable.
I guess in the meantime instead of getting a time at midnight I should
opt for another, say 11pm? I think I saw another post somewhere that
recommends doing this to combat daylight savings time problems.
And I'll wait and see whether it is something that can be addressed by
PHP or whether as you say it is an OS issue.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22163
--
Edit this bug report at http://bugs.php.net/?id=22163&edit=1