This is an old revision of the document!


Setting the time zone

When using FileRun with a webhosting service, sometimes the server is located in a different time zone than you and your users. You can adjust the time difference by either configuring PHP with a different timezone, or configuring just the FileRun installation to use your time zone.

For configuring PHP, please see this page for information on what to change in your php.ini file: https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone

For configuring just FileRun, please follow this guide:

Open the file customizables/config.php (create if doesn't exist and make sure it starts with <?php on the first line) in a text editor and add the following line:

date_default_timezone_set("Asia/Tokyo");

Replace Asia/Tokyo with your desired location. You can find here a list of available timezone codes for various locations on the planet: http://www.php.net/manual/en/timezones.php

If you want to change also the date/time formats used in the interface, these can be changed by editing the language translation files (See Translating_FileRun).

To make sure your timezone is set correctly, simply upload a file or create a new folder and look at the item's Created hour.

Setting the database time zone

Although the filesystem operations now show the correct time, database-related information, such as file comments, or user activity logs can show a different time, if the MySQL database is configured with a different time zone.

Change the MySQL server's timezone: https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html

MySQL via Docker

You can adjust the MySQL timezone easily, by adding an environmental variable TZ.

Example snippet when launching FileRun via Docker Compose:

db:
    image: mariadb:10.1
    environment:
        TZ: 'America/Los_Angeles'

When launching the MySQL container separately:

docker run -it --rm -e TZ='America/Los_Angeles' mysql:5.7 date

Last resort

If you cannot change the MySQL server's timezone, the last solution is to have FileRun sync the timezone on connection. To do that, open the file “system/data/autoconfig.php” in a text editor and add the following line at its end:

$config['db']['sync_timezone'] = true;

Important: Do not make other changes inside that file.