From:             thbley at gmail dot com
Operating system: WinXP SP2
PHP version:      5.2.3
PHP Bug Type:     Date/time related
Bug description:  Setting lastmodified file time with touch gives unexpexted 
values

Description:
------------
When I try to set the last modified time of two files to the same value, I
get different values.

Date configuration:
(php default, nothing changed, I'm living in Europe/Berlin)
date
date/time support       enabled
Timezone Database Version       2006.16
Timezone Database       internal
Default timezone        Europe/Paris

Directive       Local Value     Master Value
date.default_latitude   31.7667 31.7667
date.default_longitude  35.2333 35.2333
date.sunrise_zenith     90.583333       90.583333
date.sunset_zenith      90.583333       90.583333
date.timezone   no value        no value

Reproduce code:
---------------
<?php
// same result with date_default_timezone_set("Europe/Berlin");

touch("c:/test1.txt",strtotime("02/18/2007 20:00:00"));

touch("c:/test2.txt",filemtime("c:/test1.txt"));

echo filemtime("c:/test1.txt")."<br>\n";
echo filemtime("c:/test2.txt")."<br>\n";

echo date("d.m.Y H:i:s",filemtime("c:/test1.txt"))."<br>\n";
echo date("d.m.Y H:i:s",filemtime("c:/test2.txt"))."<br>\n";
?>

Expected result:
----------------
1171818000
1171818000
18.02.2007 18:00:00
18.02.2007 18:00:00

or

1171821600
1171821600
18.02.2007 19:00:00
18.02.2007 19:00:00

Actual result:
--------------
1171821600
1171818000
18.02.2007 19:00:00
18.02.2007 18:00:00

-- 
Edit bug report at http://bugs.php.net/?id=41786&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41786&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41786&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41786&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41786&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41786&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41786&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41786&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41786&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41786&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41786&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41786&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41786&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41786&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41786&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41786&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41786&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41786&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41786&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41786&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41786&r=mysqlcfg

Reply via email to