#38154 [Opn->Bgs]: PHP CLI filemtime() is wrong

From: Date: Thu, 20 Jul 2006 15:20:07 +0000
Subject: #38154 [Opn->Bgs]: PHP CLI filemtime() is wrong
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99677@lists.php.net to get a copy of this message
 ID:               38154
 Updated by:       mike@php.net
 Reported By:      dave at smartboy dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: Windows XP
 PHP Version:      5.1.4
 New Comment:

Set date.timezone to your timezone.


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

[2006-07-19 23:26:41] dave at smartboy dot com

Description:
------------
Using PHP CLI on Windows - filemtime() returns an incorrect value.

This problem does NOT occur with the Apache 2 SAPI.

Value reported is ahead by 9 hours (could be time zone related?  I am
in GMT+10:00 time zone)

Sample output:

$ php test_filemtime.php
2006-07-20 18:20:08

$ ls -l test_filemtime.php
-rw-r--r-- 1 Dave None 81 Jul 20 09:20 test_filemtime.php

(the above from Cygwin)

When running the exact same script inside Apache2 the correct time is
printed

2006-07-20 09:20:08


Reproduce code:
---------------
<?php

echo date('Y-m-d H:i:s', filemtime($_SERVER["SCRIPT_FILENAME"])) .
"\n";

Expected result:
----------------
2006-07-20 09:20:08

Actual result:
--------------
2006-07-20 18:20:08


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


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


Thread (10 messages)

« previous php.bugs (#99677) next »