Fix timezone issue and PHP 5.4 support

* Added support for PHP 5.4. Two functions had changed their signatures.
* Use localtime() instead of php_format_date() so that the timezone will be
  consistent in logs regardless of whether date_default_timezone_set()
  was called.
* Use ISO 8601 date format
* Tested against both PHP 5.3 and PHP 5.4.

Change-Id: I6d605f41658f7d1690cf92a9464ce0335ee8e643