ID: 21966
Comment by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Date/time related
Operating System: Gentoo Linux 1.4
PHP Version: 4.2.2
New Comment:
See what you get if you use the "r" format:
# php -r 'for($x=1; $x<=3; $x++) {
echo "$x = ".date("r", mktime(0,0,0,$x))."\n"; }'
1 = Thu, 30 Jan 2003 00:00:00 +0100
2 = Sun, 2 Mar 2003 00:00:00 +0100
3 = Sun, 30 Mar 2003 00:00:00 +0100
So apparently the "February, 30th" is turned into its normal
representation by mktime(). Although that doesn't seem to be
documented, I think that's a feature, because it helps doing date
calculations.
Previous Comments:
------------------------------------------------------------------------
[2003-01-30 12:40:30] [EMAIL PROTECTED]
#!/usr/bin/php -q
<?
system("cat test");
for($x=1; $x<=12; $x++) {
echo "$x = ".date("m", mktime(0,0,0,$x))."\n";
}
?>
1 = 01
2 = 03
3 = 03
4 = 04
5 = 05
6 = 06
7 = 07
8 = 08
9 = 09
10 = 10
11 = 11
12 = 12
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21966&edit=1