how to fix php timezone errors

occasionally, php will spew a slew of warnings or errors when one tries to use the date or time functions. these can be eliminated by setting the timezone in the /etc/php.ini file, ie.,

date.timezone = America/Los_Angeles

an application can also modify its notion of the timezone:

putenv('TZ=America/New_York');
mktime(0,0,0,1,1,1970);
echo date("H:i:s");