Articles on: Troubleshooting

Invoices Dates or Event PopUps issues

​If you are experiencing some issues with Invoices Dates or Event PopUps, it is possible that your database (MySQL) is using a different time zone than the one used by your PHP.

You can confirm this as follows:

- You can get your database (MySQL) time zone and current time by running this queries in your database (MySQL):

SELECT @@global.time_zone, @@session.time_zone, @@global.system_time_zone;

SELECT NOW();


- You can get your PHP time zone and current time by creating a .php file (for example: timezone.php) with the following code, placing it on your installation (for example: CLIENT\_EXEC\_INSTALLATION\_PATH/timezone.php) and calling it (for example: CLIENT\_EXEC\_INSTALLATION\_URL/timezone.php):

<?php
    echo date_default_timezone_get();
    echo '
';
    echo '
';
    echo date('d-m-Y H:i:s');
?>


If they have different dates and times, you will need to change them to use the same time zone.

If you do not have control on the database (MySQL) time zone, you can try contacting your database (MySQl) provider to update the time zone in your database (MySQL).

It is possible they can not do this change due to affecting other customers in their server, so the only way to make them equal is to set your PHP time zone equal to the one used by your database (MySQL).

Here are the steps to follow:

- Go to http://www.php.net/manual/en/timezones.php and search there the same timezone you are using in the database (MySQL).

You can update the .php file you created to get your PHP time zone and current time, to test assigning the new time zone and see what is the new time when using it and making sure it will be the same one used in the database (MySQL). The updated .php file will looks like:

<?php
    echo date_default_timezone_get();
    echo '
';
    echo '
';
    echo date('d-m-Y H:i:s');
    echo '
';
    echo '
';
   
    // Update the line below with the proper time zone value you searched in http://www.php.net/manual/en/timezones.php
    date_default_timezone_set('America/New_York');
    echo date_default_timezone_get();
    echo '
';
    echo '
';
    echo date('d-m-Y H:i:s');
    echo '
';
    echo '
';
?>


- Open your CLIENT\_EXEC\_INSTALLATION\_PATH/config.php file, and add something like this on it:

SPECIFIC TO YOUR TIME ZONE (CHANGE)

date\_default\_timezone\_set('');

- Update the added line in config.php: date\_default\_timezone\_set(''); with the proper value inside the quotes.

After this change, you will continue seen some Event PopUps, but they should normalize after 24 hours since the change was done.

NOTE: Take in count all your dates will be based on the database (MySQL) time zone.

Updated on: 23/02/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!