PHPackages                             pleonovich/dateedit - 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. pleonovich/dateedit

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

pleonovich/dateedit
===================

Simple way to edit date data.

1.0.0(7y ago)08Apache-2.0PHPPHP &gt;=5.0.0

Since Nov 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/pleonovich/dateedit)[ Packagist](https://packagist.org/packages/pleonovich/dateedit)[ Docs](https://github.com/pleonovich/dateedit)[ RSS](/packages/pleonovich-dateedit/feed)WikiDiscussions master Synced 3d ago

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

DateEdit
========

[](#dateedit)

Simple way to edit date data

Key features
------------

[](#key-features)

- date validation;
- date format validation;
- date format convertion;
- easy date to unix convertion;
- easy change year, month, week, day or hour.

Some examples
-------------

[](#some-examples)

### validate

[](#validate)

```
// Description:
boolean validate ( string $date , string $format )

$valid = DateEdit::validate("2017.02.03","Y.m.d");
// result: $valid = true

$valid = DateEdit::validate("2017.13.03","Y.m.d");
// result: $valid = false
```

### checkFormat

[](#checkformat)

```
// Description:
boolean checkFormat ( string $date , string $format )

$check = DateEdit::checkFormat("2017.02.03","Y.m.d");
// result: $check = true

$check = DateEdit::checkFormat("03.02.2017","Y.m.d");
// result: $check = false
```

### convertFormat

[](#convertformat)

```
// Description:
string convertFormat ( string $date , string $informat , string $outformat )

echo DateEdit::convertFormat("2017.02.03","Y.m.d","d-m-Y");
// result: 03-02-2017
```

### dateToUnix

[](#datetounix)

```
// Description:
int dateToUnix ( string $date , string $format )

echo DateEdit::dateToUnix("2017.06.18","Y.m.d");
// result: 1497744000
```

### unixToDate

[](#unixtodate)

```
// Description:
string unixToDate ( int $date , string $format )

echo  DateEdit::unixToDate(1497744000,"Y.m.d");
// result: 2017.06.18
```

### changeDate

[](#changedate)

```
// Description:
string changeDate( string $date , string $format [, string $period = 'day' [, int $NUM = 1 [, string $direction = '+' ]]] )

echo  DateEdit::changeDate( "2017.02.03" , "Y.m.d" , 'day', 1, '+');
// result: 2017.02.04
```

### changeYear

[](#changeyear)

```
// Description:
string changeYear ( string $date , string $format [, int yearN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeYear("2017.02.03", "Y.m.d", 1, '+');
// result: 2018.02.03
```

### changeMonth

[](#changemonth)

```
// Description:
string changeMonth ( string $date , string $format [, int monthN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeMonth("2017.06.17", "Y.m.d", 1, '+');
// result: 2017.07.17
```

### changeWeek

[](#changeweek)

```
// Description:
string changeWeek ( string $date , string $format [, int weekN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeWeek("2017.06.17", "Y.m.d", 1, '+');
// result: 2017.06.24
```

### changeDay

[](#changeday)

```
// Description:
string changeDay ( string $date , string $format [, int dayN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeDay("2017.06.17", "Y.m.d", 1, '+');
// result: 2017.06.18
```

### changeHours

[](#changehours)

```
// Description:
string changeHours ( string $date , string $format [, int hoursN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeHours("2017.06.17 23:39:00", "Y.m.d H:i:s", 1, '+');
// result: 2017.06.18 00:39:00
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6cedf1f24bd1ebfbe2d48ba65544bad385d9d1a83418d9c44474052df74b68b?d=identicon)[Pavel Leonovich](/maintainers/Pavel%20Leonovich)

---

Top Contributors

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

---

Tags

formatdate

### Embed Badge

![Health badge](/badges/pleonovich-dateedit/health.svg)

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

###  Alternatives

[willdurand/negotiation

Content Negotiation tools for PHP provided as a standalone library.

1.4k122.0M157](/packages/willdurand-negotiation)[rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

69810.6M39](/packages/rlanvin-php-rrule)[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[kartik-v/yii2-datecontrol

Date control module allowing separation of formats for View and Model for Yii Framework 2.0

551.5M36](/packages/kartik-v-yii2-datecontrol)[indieweb/date-formatter

Render dates and date ranges in a human-readable format, including proper microformats-2 markup

1919.7k](/packages/indieweb-date-formatter)

PHPackages © 2026

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