Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sven0188's avatar

Laravel 5.6 Shared Hosting MySQL TimeZone not working

Good day All,

I have set my TimeZone in config\app.php:

    'timezone' => 'Africa/Johannesburg',

I am on shared hosting and I have a MySQL db.

My migration file:

            $table->timestampTz("subscribed_at")->useCurrent();

But when inserting new users it does not save the date with correct TimeZone. I have clear cache / config and everything.

What am I missing here?

Please advise :)

0 likes
2 replies
Sergiu17's avatar
Sergiu17
Best Answer
Level 60

Hi, take a look in php.ini on the server, ssh into your server and run

php -i | grep timezone
1 like
Sven0188's avatar

I created a php.ini file in public folder and add following. Now all is working. Thanks!

date.timezone = Africa/Johannesburg
2 likes

Please or to participate in this conversation.