PB with timezone in the dashboard and antivirus update

/usr/share/nethesis/NethServer/Module/Dashboard/SystemStatus/Antivirus.php

 $fileList = glob('/var/lib/clamav/*.{cvd,cld}', GLOB_BRACE);
        foreach ($fileList as $file) {
            $changeTime = filemtime($file);
            if ($changeTime > $max) {
                $max = $changeTime;

so it shows ls -l /var/lib/clamav/.cld and ls -l /var/lib/clamav/.cvd and calculate max date of the file changes in those dir , so it migth be the situation that after reboot of the server freshclam update bases before time complitely sync.

stat /var/lib/clamav/*.cvd

If you want to see time of the real last freshclam start , you should change file :

Looking at the Disk Usage, I have the same…

Actually, the date and time are 2015-10-14 22:39 ( at the top there only the time )
The update: 2015-10-15 01:38 at the butom…

$timestamp = $stat[‘mtime’];
The same behavior in DUC.php mtime, so my suggestion maybe right

Check the PHP datetime is the same sa the system:

config getprop php DateTimezone
config show TimeZone

Reference:

1 Like

UTC

TimeZone=America/Belem

You just found the problem :wink:

Align the two values and you’re done.
I guess the right one is “America/Belem”.

 config setprop php DateTimezone America/Belem
 expand-template /etc/php.ini

Reference: http://php.net/manual/en/timezones.america.php

It seem the problem is deeper…

[root@microserver ~]# config setprop php DateTimezone America/Belem
[root@microserver ~]# expand-template /etc/php.ini
[root@microserver ~]# config getprop php DateTimezone
America/Belem
[root@microserver ~]# config show TimeZone
TimeZone=America/Belem

After a reconnection on the webgui, I still have the three hours of difference…
Did I need to reboot?

Finally, I rebooted…

The Dashboard show the “good” time for the antivirus update… :smiley:

But the Disk Usage, still showing the UTC time… :confused:

I suppose that config is prefferable to make through WEB UI , firstly set UTC then change to America / Belem and all config would be updated.

Oups… Forget to return this information:
All is okay in the date and time module

I will try to made a change here when I come back at home…

Good, check the right answer and solve this thread :wink:

No… The problem is only resolve in the Dashboard, not in the disk usage

Press Update on disk usage :slight_smile: for changing mtime :wink:

No…that’s not work

PS: You can easily imagine that I can’t resist to click on this big red botton :laughing:

In /usr/share/nethesis/NethServer/Module/Duc.php

if($stat) {
                     $timestamp = $stat['mtime'];
                     $date = $this->getPhpWrapper()->gmdate($view->translate('Date_Format'), $timestamp);
            }

So what to do? Change “mtime” by what?

atime

did you reaply Time zone by NS WEB UI ?

Of course … That is why I put the hands under the hood :anguished: :grin:

show pls

ll /var/cache/duc/