FAQ. Incorrect time

Материал из WiKi - UserSide

en | ru

The UserSide home page displays the wrong time


The MySQL observation applies to ERP "UserSide" versions prior to 3.12.


The system takes the time directly from the server where it is installed, without adding anything of its own. If the time is displayed incorrectly, then the problem is with the settings on the server. Check the time zone settings ( in the php.ini file the variable date.timezone), regional settings and locales. Also checking the time in mysql (time in mysql may be different from the server time) may help.

Command

select NOW();

will show the current time according to MySQL version


If MySQL time is different from system time.

For the entire MySQL server, the time zone can be changed by setting the required time zone in the configuration file. For example:

default-time-zone='+03:00'

Useful article: [[1]]


If the PHP system time (cli) is different from the database time.

For PHP, it is possible that different php.ini files are used in operation. For php-web (via which the ERP "UserSide" web interface runs), and for php-cli (via which, for example, scripts are run via cron, including the ERP "UserSide" scheduler). Often the same file is used, but sometimes it is not, and then the settings in them may be very different. Including the time zone may be different, leading to incorrect date processing and time difference messages.

How to check which php.ini file php-web uses:

Settings - Main - Various - Show PHPinfo()

The line "Loaded Configuration File" will show the path to the file.

How to see which php.ini file php-cli uses: In the "userside" directory, create for example, a file named test.php with the text inside:

<?php
phpinfo();


Then using the server console, go to this directory and execute the command

 php test.php > result.htm

The file result.htm will be generated with the output of PHPinfo. In this file, also look at the "Loaded Configuration File" path, find the file, and correct the time settings.

During the next run of the ERP "UserSide" scheduler, the time will be rechecked and if everything matches, the error will disappear.