yii2mod/yii2-timezone

Timezone helper

Maintainers

👁 disem

Package info

github.com/yii2mod/yii2-timezone

Type:yii2-extension

pkg:composer/yii2mod/yii2-timezone

Statistics

Installs: 10 740

Dependents: 1

Suggesters: 0

Stars: 14

Open Issues: 0

1.0.3 2016-03-01 08:06 UTC

Requires

None

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 0d1d9bd0d41598bc1402977c7ea15148cb91c0a4

  • Dmitry Semenov <disemx.woop@gmail.com>

componentyii2

This package is not auto-updated.

Last update: 2026-06-21 04:00:35 UTC


README

Timezone component for Yii 2

👁 Latest Stable Version
👁 Total Downloads
👁 License

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yii2mod/yii2-timezone "*"

or add

"yii2mod/yii2-timezone": "*"

to the require section of your composer.json.

Usage

Currently firefox and edge browsers are not supported.

Once the extension is installed, simply add component to your main config file:

 'bootstrap' => [
 'timezone'
 ]
 .....
 'components' => [
 'timezone' => [
 'class' => 'yii2mod\timezone\Timezone',
 'actionRoute' => '/site/timezone' //optional param - full path to page must be specified
 ],
 ]

Then add new action to any controller (SiteController by default)

public function actions()
 {
 return [
 'timezone' => [
 'class' => 'yii2mod\timezone\TimezoneAction',
 ],
 ];
 }

After configuration you can use Yii::$app->timezone->name to get current user's timezone.