HOWTO: Set Default Timezone in PHP

Setting your default timezone in PHP is a very easy task and may be needed for some applications.  If you fall into this bucket, all you need to do is….

  1. Open up your default php.ini file (or the one you wish to edit).  I can help you find your default php.ini file, if you don’t know where it is.
  2. Find the line that says ;date.timezone
  3. Uncomment that line by removing the semi-colon, then set it equal to the appropriate timezone.  For instance:
    • date.timezone = America/New_York
  4. Save the file and restart Apache

In case you’re wondering… I write these how to’s to help me remember.  Might not be so helpful for everyone else, but maybe.