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

ActiveLibrary

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 1mo ago

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 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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

1405d 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

[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[jenssegers/date

A date library to help you work with dates in different languages

1.8k11.2M80](/packages/jenssegers-date)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[carbonphp/carbon-doctrine-types

Types to use Carbon in Doctrine

213220.4M8](/packages/carbonphp-carbon-doctrine-types)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[brick/date-time

Date and time library

3623.3M61](/packages/brick-date-time)

PHPackages © 2026

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