PHPackages                             turbopixel/datr - 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. turbopixel/datr

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

turbopixel/datr
===============

Created for simple date conversion with predefined date formats.

0.2.0(3y ago)0204MITPHPPHP &gt;=7.4

Since Jul 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/turbopixel/Datr)[ Packagist](https://packagist.org/packages/turbopixel/datr)[ Docs](https://github.com/turbopixel/Datr)[ RSS](/packages/turbopixel-datr/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Datr
====

[](#datr)

### What is Datr?

[](#what-is-datr)

A simple date converter library in PHP.

### Dependencies

[](#dependencies)

- &gt;= PHP 7.4 is required

### Get Started

[](#get-started)

You can find this library at [packagist.org](https://packagist.org/packages/turbopixel/datr).

Just add Datr to the composer.json configuration file:

> composer require turbopixel/datr

And update the composer:

> composer update

Examples
--------

[](#examples)

```
// format date
var_dump( Datr::toGermanDate("2022-07-12") );
var_dump( Datr::toGermanDateTime("2022-07-12 02:47:12") );
var_dump( Datr::toEnglishDate("12.07.2022") );
var_dump( Datr::toEnglishDateTime("12.07.2022 08:12:55") ); // alias for toSql()
var_dump( Datr::toSql("12.07.2022 08:12:55") );

// output
string(10) "12.07.2022"
string(19) "12.07.2022 02:47:12"
string(10) "2022-07-12"
string(19) "2022-07-12 08:12:55"
string(19) "2022-07-12 08:12:55"

// date validation
var_dump(Datr::isValid("12.07.2022 08:12:55", "d.m.Y"));
bool(false) // -> wrong format

var_dump(Datr::isValid("12.07.2022 08:12:55", "d.m.Y H:i:s"));
bool(true)
```

Contribution
------------

[](#contribution)

Anyone can contribute to improve or fix Datr, to do so you can either report an issue (a bug, an idea...) or fork the repository, perform modifications to your fork then request a merge.

Roadmap
-------

[](#roadmap)

- pre define special country date formats

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1453d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bb81d5bdef7e45104762400e196bbc8543f828f446b6f5cb4c880940231a213?d=identicon)[turbopixel](/maintainers/turbopixel)

---

Top Contributors

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

---

Tags

convertdatedatetimeformatterformatterdatetimeconvertertimedateuhrzeit

### Embed Badge

![Health badge](/badges/turbopixel-datr/health.svg)

```
[![Health](https://phpackages.com/badges/turbopixel-datr/health.svg)](https://phpackages.com/packages/turbopixel-datr)
```

###  Alternatives

[league/period

Time range API for PHP

7335.8M24](/packages/league-period)[brick/date-time

Date and time library

3663.8M108](/packages/brick-date-time)[aeon-php/calendar

PHP type safe, immutable calendar library

20810.4M16](/packages/aeon-php-calendar)[tplaner/when

Date/Calendar recursion library.

5331.1M7](/packages/tplaner-when)[kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

461.6M3](/packages/kartik-v-php-date-formatter)[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14484.2k](/packages/dater-dater)

PHPackages © 2026

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