A neat way to change PHP / MySQL timezones at the script level

If you do any programming on shared hosting environments – like MediaTemple, Go Daddy or whatever – you’ll be familiar with the problem of timezones. While it’s easy to set the correct timezone on a server you have full control over, things get much trickier on a shared server.

However, if you’re working on PHP and MySQL there is a quick, neat fix you can apply to any scripts that rely on the system clock.