Changing local timezone in Debian server

Problem

You have developed your application in your local environment or you use it in an environment that has your local timezone, but your live deployment server is in a hosted server that has a different timezone. So a lot of the SQL queries, are not working correctly.

 

Solution

Login as root in your server and run:

dpkg-reconfigure tzdata

and then reload your database server.