PHP Timezone Handling

Today we saw another abomination of Timezone handling in PHP.
100s of lines of code were used with many hard coded values and the system was still incomplete.
So, in efforts to put a stop to this we've posted our implementation of php timezone handling which we think is easy, fast and portable.
We've included a few other examples too, but just to show why we don't use them.

javascript:void(0)