PHPackages                             davidhirtz/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. davidhirtz/yii2-datetime-behavior

ActiveYii2-extension

davidhirtz/yii2-datetime-behavior
=================================

Initiates database date columns as DateTime PHP classes.

v1.1.6(3y ago)02.0k2[1 issues](https://github.com/davidhirtz/yii2-datetime-behavior/issues)1BSD-3-ClausePHP

Since Feb 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/davidhirtz/yii2-datetime-behavior)[ Packagist](https://packagist.org/packages/davidhirtz/yii2-datetime-behavior)[ RSS](/packages/davidhirtz-yii2-datetime-behavior/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (1)

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::class,
			//'attributes'=>['custom_attribute', 'another_attribute'],
		],
	];
}
```

###  Health Score

27

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~88 days

Total

3

Last Release

1323d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4266eaf8539e1f155d297647f285c2c2ddd1f3d73f279230acb0fdec9da05af1?d=identicon)[davidhirtz](/maintainers/davidhirtz)

---

Top Contributors

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

---

Tags

datetimeyii2extension

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-widget-datetimepicker

Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)

1146.4M44](/packages/kartik-v-yii2-widget-datetimepicker)[tigrov/yii2-pgsql

Improved PostgreSQL schemas for Yii2

3465.8k](/packages/tigrov-yii2-pgsql)[nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

1283.2k1](/packages/nepstor-yii2-datetime-compare-validator)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1356.4k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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