PHPackages                             mareg/rough-date - 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. mareg/rough-date

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

mareg/rough-date
================

Rough date object allowing dates like `Jan 2005` or `2006`

1.0.6(5y ago)11.2k—0%1GPL-3.0-onlyPHPPHP ^7.2, &lt;7.5

Since Feb 22Pushed 4y ago2 watchersCompare

[ Source](https://github.com/mareg/rough-date)[ Packagist](https://packagist.org/packages/mareg/rough-date)[ RSS](/packages/mareg-rough-date/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (10)Used By (0)

Rough Date
==========

[](#rough-date)

Needed to store a "rough date" in one of my project, may be useful for otheres.

[![CI](https://github.com/mareg/rough-date/workflows/CI/badge.svg?branch=master)](https://github.com/mareg/rough-date/workflows/CI/badge.svg?branch=master)[![Build Status](https://camo.githubusercontent.com/3ef98bf5bdfe243896a72d88b1957e56fd8696cdeff34f677588b12764a084fa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617265672f726f7567682d646174652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mareg/rough-date/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bd596544104ddfdc629746e0db2c2abd65804528f2f47e66c50d5b5cb88b059b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617265672f726f7567682d646174652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mareg/rough-date/?branch=master)[![License: GPL v3](https://camo.githubusercontent.com/1b0c7e4911720d0444c16a1ffd145a039f14a1a7305362ab51184f757a4dd6bc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323076332d626c75652e737667)](https://www.gnu.org/licenses/gpl-3.0)

Installation
============

[](#installation)

Execute from shell the following command:

```
$ composer require mareg/rough-date
```

Or add `"mareg/rough-date": "^1.0"` to your `composer.json`:

```
    "require": {
        "mareg/rough-date": "^1.0"
    },
```

Usage
=====

[](#usage)

Create a `RoughDate` object from the string:

```
$roughDate = RoughDate::fromString('May 2005');
echo $roughDate->format();
```

Or from a `DateTime` date object:

```
$date = new \DateTime();
$roughDate = RoughDate::fromDateTime($date);
echo $roughDate->format();
```

Accepted date formats
---------------------

[](#accepted-date-formats)

When creating an object through `RoughDate::fromString()`:

- `Y-m-d`, e.g. `2015-02-22`, but also `2013-05-00` and `2013-00-00` are correct
- `Y/m/d` and `Y.m.d` are accepted
- `j. M Y`, e.g. `13. May 2005`
- `M Y`, e.g. `May 1985`
- `Y`, e.g. `1978`

Output date formats
-------------------

[](#output-date-formats)

When calling `RoughDate::format()`:

- For a full date output accepts all variables as in [date()](http://php.net/manual/en/function.date.php) method
- For other dates only available variables will be substituded and unavailable ones will be removed, e.g.:
- for date `2015-02-00` and format `j M Y` you'll get `Feb 2015`
- for date `1978-00-00` and format `j M Y` you'll get `1978`

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~281 days

Recently: every ~214 days

Total

9

Last Release

1850d ago

Major Versions

0.1.3 → 1.0.12018-05-26

PHP version history (3 changes)0.1.1PHP &gt;=5.4

1.0.1PHP &gt;=7.2

1.0.3PHP ^7.2, &lt;7.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/533217?v=4)[Marek Matulka](/maintainers/mareg)[@mareg](https://github.com/mareg)

---

Top Contributors

[![mareg](https://avatars.githubusercontent.com/u/533217?v=4)](https://github.com/mareg "mareg (44 commits)")[![jakzal](https://avatars.githubusercontent.com/u/190447?v=4)](https://github.com/jakzal "jakzal (4 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

### Embed Badge

![Health badge](/badges/mareg-rough-date/health.svg)

```
[![Health](https://phpackages.com/badges/mareg-rough-date/health.svg)](https://phpackages.com/packages/mareg-rough-date)
```

PHPackages © 2026

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