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?
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
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
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.
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
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 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!
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