ID:               20596
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Date/time related
 Operating System: WIN 2000
 PHP Version:      4.2.1
 New Comment:

The second argument of date() should be an integer timestamp, not a
string. You can use e.g. mktime() or strtotime() to get such a
timestamp:

# php -r 'echo date("t", mktime(0,0,0,9,1,2002)),"\n";'
30


Previous Comments:
------------------------------------------------------------------------

[2002-11-23 09:30:04] [EMAIL PROTECTED]

<?php
// As September has 30 days $x, $y & $z should all be
// 30 ... instead the result is always 31
// Unfortunately cal_days_in_month is not supported on the
// target server (php 4.1.2) even though though the
// documentation says it is

$x = date('t', '1 Sep 2002');
$y = date('t', 'Sep');
$z = date('t', '2002-09-01');
?>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20596&edit=1

Reply via email to