#22163 [Com]: mktime returns -3662
| From: | jim at babylamb dot com | Date: | Sat, 17 May 2003 09:44:24 +0000 |
| Subject: | #22163 [Com]: mktime returns -3662 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39833@lists.php.net to get a copy of this message | ||
ID: 22163
Comment by: jim at babylamb dot com
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 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.
Previous Comments:
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
[2003-02-12 09:50:56] mgf@php.net
OK! That actually seems reasonable. In Europe at least, the DST
time-change is defined to take place at 01:00:00, so the hour from
01:00:00 to 01:59:59 does not exist on that date.
So it look like the bug is that the times for the hour between 00:00:00
and 00:59:59 are wrong on a date when the clock goes back for DST.
Now that we have this pinned down, I'm going to kick this to a
developer who knows about the relevant bits of the PHP source to say
whether this is something PHP can address, or whether it's a bug in the
date/time handling of MacOS X that you'll just have to live with.
------------------------------------------------------------------------
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