Programming Tips - PHP: get the name of the local time zone in php

Date: 2014nov25 Language: php Q. PHP: get the name of the local time zone in php A. 'T' from the date() function will do it. You do not have to give date() a time since it doesn't matter for the timezone.
<?php # This is what you usually want - eg "EST" function getTimeZoneAbbrev() { return date('T'); } function getTimeZoneName() { return date('e'); } # Example use print getTimeZoneName(); ?>