|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-06-16 14:39 UTC] till at klimpong dot com
Description:
------------
ftp_mdtm always returns a wrong unix timestamp.
Our FTPd is proftpd (with TimesGMT off). The date, time and timezone are set correctly on the server.
When I connect to the FTP with another client (such as filezilla), all dates are displayed correct. This error only occurs within a PHP script.
For example:
current time on the server: 2:24PM
current time returned by ftp_mdtm: 4:24 PM
This example works:
<?php
echo strftime("%d.%m.%Y - %H:%M");
?>
Displays the correct time, so I guess this problem comes from ftp_mtdm().
Reproduce code:
---------------
<?php
$file = 'somefile.foo';
$ts = file_mtdm($file);
echo strftime("%d.%m.%Y - %H:%M", $ts);
?>
Expected result:
----------------
File's modification time.
Actual result:
--------------
The file's modification time plus two hours.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 10:00:01 2025 UTC |
You have extra '1' in the timestamp. (typo, I hope :) # php -r 'echo gmdate("F d Y H:i:s", 1118931496);' June 16 2005 14:18:16 That looks pretty okay to me.