Files through FTP with a different date and time and File Manager change for 24 hours

My PHP is with Time Zone and Cloud is in the right Time Zone, but I see the files through FTP and through the File Manager with a different date and time!

How do I resolve this?

XXXX@XXXX:~$ date
Fri Nov 17 19:27:40 -03 2023
XXXX@XXXX:~$

In File Manager Show

23/11/17 07:27:40

FTP Show

23/11/17 16:27:40

The correct thing is the time first, I don’t understand why in FTP it shows one time and in the file explorer another, do I need to configure anything else?

The time is correct but FileGator (File Manager used by Hestia) is not configured to use 24 hours format.

You can modify the configuration to change date_format but it could be overwritten in next update.

The file is /usr/local/hestia/web/fm/configuration.php and you can add this to use 24 hours format:

$dist_config["frontend_config"]["date_format"] = 'YY/MM/DD H:mm:ss';

Add it below this line:

$dist_config["frontend_config"]["upload_max_size"] = 1024 * 1024 * 1024;

You should check the time zone assigned to the machine running that ftp client and also check your ftp client because maybe you need to configure it to match the time zone used by your server.

Edit: If you are using vsftpd as ftp server, you can change directive use_localtime from YES to NO in /etc/vsftpd.conf

use_localtime=NO

and restart the service:

systemctl restart vsftpd
1 Like

My FTP is use_localtime=YES

I tested my ftp client on another server that is not hestia and the time displays correctly!

XXXX@XXXX:~$ timedatectl
               Local time: Fri 2023-11-17 20:35:11 -03
           Universal time: Fri 2023-11-17 23:35:11 UTC
                 RTC time: Fri 2023-11-17 23:35:12
                Time zone: America/Sao_Paulo (-03, -0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
XXXX@XXXX:~$

Yes, you are right in this case, it is only wrong in FTP

FTP is 17:35 PM

Thanks

Yes, change it to NO. The problem is that your FTP client is using a timezone -3 and it thinks the time shown by your FTP server is UTC so it substracts 3 hours but your server is already using the right time zone (-3) so in your client you are actually seeing -6.

Is there a way to fix this directly in Hestia?

Thanks Maison

From Web UI? No, you must edit the file manually.

I say send a correction so it can get the server’s time zone!
Won’t this be lost in future updates?

Thanks
Maison

Ok, I didn’t understand what you meant.

Well, the default value for use_localtime is NO, I don’t know the reasons it is configured as YES in Hestia but keep in mind that this is not a bug, it is an issue in your FTP client that it is trying to use the timezone in your client machine instead of doing nothing and getting the time that is shown by your FTP server.

As far as I know that conf file won’t be overwritten in upgrades but… all conf files could be modified in future upgrades so keep a list of all mods that you performed to Hestia :wink:

Yes, changing it to does “NO” solve the problem!
I don’t know why it was like YES, I didn’t make any changes!

Thanks
Maison

1 Like

No no, you didn’t change anything, I said that default value is NO in a default install but Hestia updates the conf and changes the value to YES.

1 Like

I understand, sorry and thank you

1 Like

But if the timelocal is YES, why doesn’t it get the TimeLocal from the server? Is this an error in the FTP server?

Thanks

It does, when it’s set to YES, the FTP server sends the right time (following your example, it sends 19:27:40) but your FTP Client thinks that the time is UTC and uses the timezone in your client machine to substract 3 hours so it shows 16:27:40. If you set the value to NO, your FTP Server will send the UTC time (22:27:40) and your FTP client substracts 3 hours and you get the right time (19:27:40) so, here the “problem” is the FTP client you are using.

I use WinSCP, can you tell me what I need to adjust?

An out of context question, do you use a WordPress template for Nginx to block access to the xmlrpc.php file?

Thanks
Maison

I don’t use Windows so no idea what are the options for WinSCP.

I don’t use Wordpress but if you want to allow some ip to that file and deny access for all, you can use something like this:

location = /xmlrpc.php {
    allow a.b.c.d/24;
    deny all;
}

But it should be better to open a new topic for this question.

1 Like

You mentioned here that it is not possible to edit via the web, but is it possible or is there a problem?

/edit/server/vsftpd/

Thanks
Maison

I meant that there isn’t a specific option to do it from Web UI. Yes, you can edit the vsftpd conf file from service list in Hestia, no problem.

1 Like

I updated the timezone through the Hestia panel to UTC then to my timezone, so only the localtime stays with my timezone which is correct, in this case only the “NO” option solves the problem, it would be good for the Hestia team set " NO" it as default since Most people put their timezone and it is “NO” the default value!

http://vsftpd.beasts.org/vsftpd_conf.html#:~:text=Default%3A%20NO-,use_localtime,-If%20enabled%2C%20vsftpd

use_localtime
If enabled, vsftpd will display directory listings with the time in your local time zone. The default is to display GMT. The times returned by the MDTM FTP command are also affected by this option.

Default: NO

~# timedatectl
               Local time: Sat 2023-11-18 10:00:37 -03
           Universal time: Sat 2023-11-18 13:00:37 UTC
                 RTC time: Sat 2023-11-18 13:00:38
                Time zone: America/Sao_Paulo (-03, -0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Thanks Maison

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.