Client portal

Invoices Dates or Event PopUps issues

 November 21, 2014     0 Comments

‚Äč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.

How helpful was this article to you?

Posting has been disabled.