note 13787 modified in function.mktime.php by zak
| From: | zak@php.net | Date: | Tue, 10 Jul 2001 20:22:30 +0000 |
| Subject: | note 13787 modified in function.mktime.php by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15179@lists.php.net to get a copy of this message | ||
[Editor's Note: The behavior described below is not a bug. Placing a 0 at the start of a number
means that PHP will interprete it as being a octal (base 8) instead of decimal (base 10) number. 08
is an illegal value for a base 8 number.
--zak@php.net]
While i tried to calculate the age out of the birthday o.s., following error occured:
mktime(0, 0, 0, 08, 14, 2001); returned 976748400. But it SHOULD return 997740000.
Then I tried:
mktime(0, 0, 0, 07, 14, 2001); returned 995061600
This result was correct...
So I think, there is a bug in the mktime function.
In my script I used then the function strtotime().
Both functions returning the seconds between the given date and the 1.1.1970. mktime sometimes wrong
and strtotime always proper with the same input(!).
http://www.php.net/manual/en/function.mktime.php.php