You can set the time zone for PHP using either of the methods you tried. However, note that those only set the timezone for PHP on that specific website.
Setting the PHP timezone doesn’t change the database timezone. The database timezone is governed by the system time of the database server. This time cannot be set for individual databases or users.
So when working with time, make sure to always use the web server time from PHP. Don’t use the time from the database server using functions like NOW()
in the query. Instead, generate specific timestamps from your PHP code.