symfony - Symfony2 user timezone -


i building symfony2 app user can choose timezone. made neseccary model/form changes store timezone field in user object.

to apply timezone inside specific controller action can use:

$user = $this->get('security.context')->gettoken()->getuser(); date_default_timezone_set( $user->gettimezone() ); 

is there way without having modify every controller/action?


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -