PHPackages                             wazum/datetime-fractional-seconds - 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. wazum/datetime-fractional-seconds

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

wazum/datetime-fractional-seconds
=================================

Custom Doctrine type for DATETIME with fractional seconds support

1.1.0(2y ago)08PHPPHP ^8.2CI failing

Since Jun 7Pushed 8mo ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (4)Used By (0)

DATETIME with fractional seconds support
========================================

[](#datetime-with-fractional-seconds-support)

[![CI](https://github.com/wazum/datetime-fractional-seconds/actions/workflows/ci.yml/badge.svg)](https://github.com/wazum/datetime-fractional-seconds/actions/workflows/ci.yml)

A TYPO3 custom Doctrine type for DATETIME with fractional seconds support.

Compatible with TYPO3 12 LTS and 13 on PHP 8.2+.

Use case
--------

[](#use-case)

If you need more control over the order of records in your database you need fractional seconds precision.

Let's assume you have an event driven system and store events in the database and multiple events are stored in the same second (very likely), you need a higher precision timestamp if you ever want to process your event streams in the right order.

Background
----------

[](#background)

Doctrine (the ORM used by TYPO3) does not support fractional seconds for `DATETIME` fields.

There's an open issue about that here: [doctrine/dbal#2873](https://github.com/doctrine/dbal/issues/2873)

Prerequisites
-------------

[](#prerequisites)

A database that supports DATETIME with fractional seconds is required. 👆 This extension supports MariaDB 10.2+, MySQL 5.7+ and PostgreSQL 10+. Other database systems are not affected and will fall back to the default behavior.

You'll find a list of supported database systems in this comment here: [doctrine/dbal#2873 (comment)](https://github.com/doctrine/dbal/issues/2873#issuecomment-602283947)

Please submit a pull request if you need this behavior with TYPO3 and implemented it yourself.

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

[](#installation)

```
composer require "wazum/datetime-fractional-seconds"

```

Usage
-----

[](#usage)

After installation every `DATETIME` field in `ext_tables.sql` with a *fractional seconds precision* — e.g. `occurred_on DATETIME(6)` — will be created with this length (6). Any `DATETIME` field without a precision length will be created without it (the default behavior).

With a precision on the database field you can then use a format that supports this in your code (the `.u` in the following example for a length of six).

FormatDescriptionExamplevMilliseconds (up to three digits)`12.345`uMicroseconds (up to six digits)`45.654321`See  for format options.

```
private const DATETIME_FORMAT = 'Y-m-d H:i:s.u';

public function __invoke(SomethingHappened $event): void
{
    $occurredOn = \DateTimeImmutable::createFromFormat(
        self::DATETIME_FORMAT,
        $event->getOccurredOn()
    );
}
```

Possible problems
-----------------

[](#possible-problems)

### Extending `ConnectionPool`

[](#extending-connectionpool)

This extension extends the Core `ConnectionPool` to get a database connection.

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Database\ConnectionPool::class] = [
    'className' => \Wazum\DatetimeFractionalSeconds\Core\Database\ConnectionPool::class
];

```

If you use another extension which does the same, you have to handle this yourself.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance43

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~185 days

Total

3

Last Release

1065d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.1.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wazum-datetime-fractional-seconds/health.svg)

```
[![Health](https://phpackages.com/badges/wazum-datetime-fractional-seconds/health.svg)](https://phpackages.com/packages/wazum-datetime-fractional-seconds)
```

###  Alternatives

[in2code/migration

Framework for any kind of TYPO3 migrations and imports. Also exports and imports content from and to json files.

6277.0k3](/packages/in2code-migration)[lolli/dbdoctor

TYPO3 Database doctor - Find and fix TYPO3 database inconsistencies

43103.5k](/packages/lolli-dbdoctor)[friendsoftypo3/typo3db-legacy

TYPO3\_DB compatibility layer

12521.7k5](/packages/friendsoftypo3-typo3db-legacy)[bmack/site-importer

Imports records from a Yaml file structure into the TYPO3 database

2383.2k](/packages/bmack-site-importer)[stefanfroemken/mysqlreport

Analyze and profile your TYPO3 databases queries

1314.9k](/packages/stefanfroemken-mysqlreport)

PHPackages © 2026

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