动态设置应用程序php的时区

I want to give my users an option to change the time zone(tmz).
I am using date_default_timezone_set($tmzName)
but this means I need to set it again in every page/action/ajax call, is there a way
to set it for the entire application when the user changes it?
I am using Yii if that helps.

Yii::app()->localtime->Locale = $user->locale->code; // eg 'en_gb' 
Yii::app()->localtime->TimeZone = $user->timezone->name; // eg 'Europe/London'

for details : http://www.yiiframework.com/wiki/197/local-time-zones-and-locales/

You can return time zone for a Yii application using

Yii::app()->timeZone;

You can save user's preferred time zone in db or CWebUser state and use

Yii::app()->timeZone = 'user_preferred_time_zone';

You could use this after successful login in Your login method.

http://www.yiiframework.com/doc/api/1.1/CApplication#timeZone-detail