From:             aksuska at esoteritech dot com
Operating system: Linux 2.4.25 (RH)
PHP version:      4.3.4
PHP Bug Type:     Date/time related
Bug description:  Strtotime() or Date() Imroper Handling of time

Description:
------------
Time values are (IMHO) calculated incorrectly from 
strtotime(), or as passed through date(). See example 
below.

Config:
---------------------------
'./configure' '--prefix=/usr/local/' '--with-apxs=/etc/
httpd/bin/apxs' '--disable-cgi' '--enable-versioning' '--
enable-pic' '--disable-posix-threads' '--enable-memory-
limit' '--with-pear=/usr/local/lib/php' '--with-openssl=/
usr/local/ssl' '--disable-debug' '--enable-magic-quotes' '-
-disable-rpath' '--with-bz2=/usr' '--with-zlib' '--enable-
bcmath' '--enable-calendar' '--enable-ftp' '--enable-exif' 
'--with-curl=/usr' '--enable-dba' '--with-gdbm=/usr' '--
with-flatfile' '--with-inifile' '--enable-dbase' '--with-
gd' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--
with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-
gettext=/usr' '--with-gmp' '--with-imap=/usr/local' '--
with-imap-ssl=/usr/local/ssl' '--enable-mbstring' '--
enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt=/
usr' '--with-mhash=/usr' '--with-unixODBC=/usr/local/
unixODBC' '--with-mysql=/usr/local/mysql' '--enable-
sockets' '--with-regex=system' '--enable-wddx' '--with-
expat-dir=/usr' '--enable-xslt' '--with-xslt-sablot=/usr' 
'--enable-inline-optimization' '--with-pspell=/usr/local'
----------------

php.ini diff:
-------------------
I can't provide this as the server isn't mine. I canb, 
however, provide a phpinfo() output on request.
--------------------

Reproduce code:
---------------
<?
$date = '3/31/04';
print date( 'Y-m-d H:m:s', strtotime( $date ) ) . "<BR>";

$date = date( 'm/d/y', time() );
print date( 'Y-m-d H:m:s', strtotime( $date ) ) . " ($date)<BR>";

$date = '03/31/04 00:00:00';
print date( 'Y-m-d H:m:s', strtotime( $date ) ) . "<BR>";

$date = '03/31/04 03:25:19';
print date( 'Y-m-d H:m:s', strtotime( $date ) ) . "<BR>";
?>

Expected result:
----------------
2004-03-31 00:00:00
2004-05-28 00:00:00 (05/28/04)
2004-03-31 00:00:00
2004-03-31 03:25:19


Actual result:
--------------
2004-03-31 00:03:00
2004-05-28 00:05:00 (05/28/04)
2004-03-31 00:03:00
2004-03-31 03:03:19


-- 
Edit bug report at http://bugs.php.net/?id=28562&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28562&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28562&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28562&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28562&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28562&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28562&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28562&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28562&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28562&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28562&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28562&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28562&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28562&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28562&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28562&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28562&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28562&r=float

Reply via email to