php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41786 Setting lastmodified file time with touch gives unexpexted values
Submitted: 2007-06-24 07:21 UTC Modified: 2007-06-27 11:40 UTC
From: thbley at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.3 OS: WinXP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: thbley at gmail dot com
New email:
PHP Version: OS:

 

 [2007-06-24 07:21 UTC] thbley at gmail dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-24 13:13 UTC] sniper@php.net
See also bug #41751

 [2007-06-27 11:40 UTC] tony2001@php.net
Duplicate of bug #40568.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jun 02 23:01:26 2025 UTC