Jump to content

Warning database time differs from php time


Recommended Posts

Posted

I think this may be trivial but just asking here in case.... I imported a database from a pw installation running on server hosted in France. My php time on my localhost is on UK time so now I get this warning:-

Warning, the database time differs from PHP time by 59 minutes 54 seconds.

2026-05-07 09:40:52 - database time
2026-05-07 08:40:58 - PHP time

Please edit your /site/config.php file and update your $config->timezone to match that of your database

That is clear enough, but presumably changing the config timezone will put my local pw install on French time, which I don't really want.

Does it really matter this warning....are there any further implications? 

Thanks for any input 

 

Posted

Hello @rushy,

I think it only matters if you want the correct created and modified timestamp when creating or editing pages. I don't think there are any further implications.

You could try this script in your config.php. It worked for me: 

 

Posted

Honestly, for a local dev environment, it’s mostly just an annoyance. The main "risk" is that your timestamps for things like page edits, logs, or scheduled tasks will be an hour off. If you’re just building and testing layout or logic, you can safely ignore the warning.

However, if you're testing anything time-sensitive (like countdowns, expiring links, or publishing schedules), that one-hour gap will definitely trip you up.

Instead of changing your whole system, you can usually just sync them in your config.php as the error suggests:

PHP
$config->timezone = 'Europe/Paris';
Since it's just your local install, it won't affect your physical clock, and it makes the warning vanish. If the time difference bothers you while looking at the "Last Modified" dates, just keep it as is—nothing is going to "break" the database.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...