Wrangling dates and times can be a somewhat arduous task for all programmers. One very common requirement is to convert a time from one time zone to another.

In PHP this is greatly simplified with the DateTime standard library classes and especially DateTimeZone.

For this example let us assume we have a UTC date and time string (2011-04-27 02:45) that we would like to convert to ACST (Australian Central Standard Time).

After some experimentation between time zones that do and do not currently have DST (Day Light Savings Time) I have discovered that this will take DST into account.

Anyway a very simple tip for moving dates around in PHP.