#41751 [Opn]: touch() works incorrectly in Windows.
ID: 41751 Updated by: [EMAIL PROTECTED] Reported By: aeolianmeson at blitzeclipse dot com Status: Open Bug Type: *General Issues Operating System: Windows XP SP2 PHP Version: 5.2.3 New Comment: See also bug #41786 Previous Comments: [2007-06-21 13:38:30] aeolianmeson at blitzeclipse dot com It's set to 'America/Detroit' at runtime, which is still -5 (or -4 during DST). [2007-06-21 13:37:27] [EMAIL PROTECTED] Yes, that's how it should work but maybe not. What is date.timezone set for you? [2007-06-21 13:33:41] aeolianmeson at blitzeclipse dot com Timezone is set to -5 at runtime. OS is setting to Detroit (-5)... But, timezones don't matter until epoch times are converted to strings-- This wouldn't apply since we're just talking about the timestamps. [2007-06-21 13:30:28] [EMAIL PROTECTED] Of course. What is your system timezone set to? And what about the timezone setting in php.ini, date.timezone ? [2007-06-20 22:30:10] aeolianmeson at blitzeclipse dot com Plus, this only happens with Windows. Dustin The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/41751 -- Edit this bug report at http://bugs.php.net/?id=41751edit=1
#41751 [Opn]: touch() works incorrectly in Windows.
ID: 41751 User updated by: aeolianmeson at blitzeclipse dot com Reported By: aeolianmeson at blitzeclipse dot com Status: Open Bug Type: *General Issues Operating System: Windows XP SP2 PHP Version: 5.2.3 New Comment: Plus, this only happens with Windows. Dustin Previous Comments: [2007-06-20 22:27:45] aeolianmeson at blitzeclipse dot com It's just easier to see when I use (0). I was using normal timestamps before. [2007-06-20 22:26:26] [EMAIL PROTECTED] Actually I think it's just the thing that you pass '0' to touch() as 2nd parameter.. [2007-06-20 21:58:56] aeolianmeson at blitzeclipse dot com 1182376591 1182376591 ctime doesn't appear to be afflicted. Dustin Oprea [2007-06-20 21:53:45] [EMAIL PROTECTED] What does this output for you: ?php echo time(), \n; touch('b'); // 2nd parameter is optional.. $b = stat('b'); echo $b['ctime'], \n; ? [2007-06-20 21:28:11] aeolianmeson at blitzeclipse dot com Description: Touch appears to always apply a timestamp that is exactly one-hour earlier then the given timestamp, in Windows. It appears to work fine in PHP 5.0.4 and 4.1.2 in Linux. Reproduce code: --- touch('b', 0); var_dump(stat('b')); Expected result: array(26) { [0]= int(2) [1]= int(0) [2]= int(33206) [3]= int(1) [4]= int(0) [5]= int(0) [6]= int(2) [7]= int(0) [8]= int(-3600) [9]= int(-3600) [10]= int(1182374129) [11]= int(-1) [12]= int(-1) [dev]= int(2) [ino]= int(0) [mode]= int(33206) [nlink]= int(1) [uid]= int(0) [gid]= int(0) [rdev]= int(2) [size]= int(0) [atime]= int(0) [mtime]= int(0) [ctime]= int(1182374129) [blksize]= int(-1) [blocks]= int(-1) } Actual result: -- // mtime and ctime are -3600. array(26) { [0]= int(2) [1]= int(0) [2]= int(33206) [3]= int(1) [4]= int(0) [5]= int(0) [6]= int(2) [7]= int(0) [8]= int(-3600) [9]= int(-3600) [10]= int(1182374129) [11]= int(-1) [12]= int(-1) [dev]= int(2) [ino]= int(0) [mode]= int(33206) [nlink]= int(1) [uid]= int(0) [gid]= int(0) [rdev]= int(2) [size]= int(0) [atime]= int(-3600) [mtime]= int(-3600) [ctime]= int(1182374129) [blksize]= int(-1) [blocks]= int(-1) } -- Edit this bug report at http://bugs.php.net/?id=41751edit=1