PHPackages                             tessera-php/tessera-type-datetime - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tessera-php/tessera-type-datetime

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tessera-php/tessera-type-datetime
=================================

Tessera type: DateTime

06PHP

Since Feb 23Pushed 2mo agoCompare

[ Source](https://github.com/tessera-php/tessera-type-datetime)[ Packagist](https://packagist.org/packages/tessera-php/tessera-type-datetime)[ RSS](/packages/tessera-php-tessera-type-datetime/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Tessera Type: DateTime
======================

[](#tessera-type-datetime)

Тип datetime для Tessera.

Установка
---------

[](#установка)

```
composer require tessera-php/tessera-type-datetime
```

Использование
-------------

[](#использование)

```
use Tessera\Type\Datetime\DatetimeType;
use Tessera\Type\Datetime\DatetimeData;

$type = new DatetimeType();

// Валидация
$type->validate(new DateTimeImmutable());  // true
$type->validate('2024-06-15 10:30:00');    // true
$type->validate('2024-06-15T10:30:00Z');   // true
$type->validate(1718438400);               // true (unix timestamp)
$type->validate('invalid');                // false

// Нормализация
$data = $type->normalize('2024-06-15 10:30:00');
echo $data->value->format('Y-m-d H:i:s');  // 2024-06-15 10:30:00

// DTO
$data = new DatetimeData(new DateTimeImmutable('2024-06-15'));
echo $data->value->format('Y-m-d');        // 2024-06-15
```

Принимаемые форматы
-------------------

[](#принимаемые-форматы)

- `DateTimeInterface` — объекты DateTime и DateTimeImmutable
- `string` — строка даты/времени (парсинг через DateTimeImmutable)
- `int` — unix timestamp

Часовой пояс
------------

[](#часовой-пояс)

Для строк без указания часового пояса используется `date_default_timezone_get()`.

Контракт
--------

[](#контракт)

`provide: tessera-contract-type/datetime`

Лицензия
--------

[](#лицензия)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance56

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![targrik](https://avatars.githubusercontent.com/u/6997825?v=4)](https://github.com/targrik "targrik (2 commits)")

### Embed Badge

![Health badge](/badges/tessera-php-tessera-type-datetime/health.svg)

```
[![Health](https://phpackages.com/badges/tessera-php-tessera-type-datetime/health.svg)](https://phpackages.com/packages/tessera-php-tessera-type-datetime)
```

###  Alternatives

[ishanvyas22/asset-mix

Asset Mix plugin for CakePHP

3375.4k2](/packages/ishanvyas22-asset-mix)[prgayman/laravel-zatca

Laravel package a helper to Generate the QR code and signed it for ZATCA E-invoicing

2926.9k1](/packages/prgayman-laravel-zatca)[ducks-project/spl-types

Polyfill Module for SplType PHP extension. This extension aims at helping people making PHP a stronger typed language and can be a good alternative to scalar type hinting. It provides different typehandling classes as such as integer, float, bool, enum and string

1032.4k](/packages/ducks-project-spl-types)

PHPackages © 2026

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