PHPackages                             easyconn/yii2-datetime-behavior - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. easyconn/yii2-datetime-behavior

ActiveYii2-extension[Database &amp; ORM](/categories/database)

easyconn/yii2-datetime-behavior
===============================

Initiates database date columns as DateTime PHP classes.

1.0.0(8y ago)07BSD-3-ClausePHP

Since Mar 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zz/yii2-datetime-behavior)[ Packagist](https://packagist.org/packages/easyconn/yii2-datetime-behavior)[ RSS](/packages/easyconn-yii2-datetime-behavior/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Yii2 DateTime Behavior
======================

[](#yii2-datetime-behavior)

Initiates database date columns as DateTime PHP classes.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist davidhirtz/yii2-datetime-behavior "*"

```

or add

```
"davidhirtz/yii2-datetime-behavior": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by adding it to your ActiveRecord behavior. If you don't set the attributes all "date" and "datetime" columns will be automatically selected.

```
use davidhirtz\yii\datetime\DateTimeBehavior;
public function behaviors()
{
	return [
		[
			'class'=>DateTimeBehavior::className(),
			//'attributes'=>['custom_attribute', 'another_attribute'],
		],
	];
}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3014d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4ac4a61a375acd610e910c3a85beace8bf6dedc6c26ce52ba590c094d4755ed?d=identicon)[zhuzhu](/maintainers/zhuzhu)

---

Top Contributors

[![davidhirtz](https://avatars.githubusercontent.com/u/973624?v=4)](https://github.com/davidhirtz "davidhirtz (14 commits)")[![zz](https://avatars.githubusercontent.com/u/41499?v=4)](https://github.com/zz "zz (1 commits)")

---

Tags

datetimeyii2extension

### Embed Badge

![Health badge](/badges/easyconn-yii2-datetime-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/easyconn-yii2-datetime-behavior/health.svg)](https://phpackages.com/packages/easyconn-yii2-datetime-behavior)
```

###  Alternatives

[tigrov/yii2-pgsql

Improved PostgreSQL schemas for Yii2

3469.3k](/packages/tigrov-yii2-pgsql)[johnitvn/yii2-ajaxcrud

Gii CRUD template for Single Page Ajax Administration for yii2

97213.6k16](/packages/johnitvn-yii2-ajaxcrud)[dmstr/yii2-migrate-command

Console Migration Command with multiple paths/aliases support

31297.1k6](/packages/dmstr-yii2-migrate-command)[dmstr/yii2-db

Database extensions

19642.9k6](/packages/dmstr-yii2-db)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
