note 13787 deleted from function.mktime by hholzgra
| From: | hholzgra@php.net | Date: | Sun, 14 Apr 2002 22:09:53 +0000 |
| Subject: | note 13787 deleted from function.mktime by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29328@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(!).