php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28083 Erroneous date returned by filemtime()
Submitted: 2004-04-20 22:30 UTC Modified: 2004-04-20 23:23 UTC
From: obrut at abv dot bg Assigned: wez (profile)
Status: Not a bug Package: Date/time related
PHP Version: 4.3.6 OS: Microsoft Windows XP SP1
Private report: No CVE-ID: None
 [2004-04-20 22:30 UTC] obrut at abv dot bg
Description:
------------
When using filemtime(), filectime and stat() erroneous date is returned for some files. For ex. 31 Feb 2004 which of course is not the right date. The OS reports correct date. On some files the difference between the returned and the actual file date is exactly one month. Mostly the deviation from the real date remains unidentified.

PHP is installed as an Apache module in Apache 2.0.49

I suppose this is an OS-related issue. No one reported such problem under Linux for example.

Reproduce code:
---------------
echo date( "d.h.Y H:i:s", filemtime( "./IP.txt" ) ); 

Expected result:
----------------
20.04.2004 15:08:14

Actual result:
--------------
20.03.2004 15:08:14

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-20 22:53 UTC] wez@php.net
I had this same problem (bogus mtime) under XP too,
but put it down to windows misbehaving.
I'll investigate.
 [2004-04-20 23:23 UTC] wez@php.net
code is identical for win32 and unix; therefore the
problem must lie within the M$ VCRT library, and isn't
something we can fix.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 05:01:29 2024 UTC