PHPackages                             patipark/mydate - 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. patipark/mydate

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

patipark/mydate
===============

class utility วันที่

1.0.0(4y ago)0109MITPHPPHP ^7.2

Since May 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/patipark/mydate)[ Packagist](https://packagist.org/packages/patipark/mydate)[ RSS](/packages/patipark-mydate/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

mydate
======

[](#mydate)

ใช้ทดสอบวันที่

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require patipark/mydate "dev-master"

```

or add

```
"patipark/mydate": "dev-master"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

- on view

```
use patipark\MyDate;

if (MyDate::isValidDate('2021-04-30')) {
    // รูปแบบวันที่ถูกต้อง
    .......
} else {
    // รูปแบบวันที่ไม่ถูกต้อง
    .......
}
echo MyDate::lastDateOfMonth(2021, 2) . "\n";       //2021-02-28 00:00:00
echo MyDate::listMonth()[4] . "\n";                 //เมษายน
foreach (MyDate::listYear(2021) as $key => $val) {  // [2564 , 2565]
    echo $val . "\n";
}
$listDayOfMonth = MyDate::listDayOfMonth(2021, 2);  //return array(1-28)
var_dump($listDayOfMonth);
$date = new MyDate('2021-04-09');
echo $date->getTimezone() . "\n";                   //Asia/Bangkok
echo $date->getDay() . "\n";                        //09
echo $date->getMonth() . "\n";                      //เมษายน
echo $date->getYear() . "\n";                       //2564
echo $date->format('วัน::DDD:: ที่ d ::MMM:: พ.ศ.::YYYY::') . "\n"; //วันศุกร์ ที่ 30 เมษายน พ.ศ.2564

.......
.......
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

1810d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10300449?v=4)[Patipark Sopha](/maintainers/Patipark)[@patipark](https://github.com/patipark)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/patipark-mydate/health.svg)

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

###  Alternatives

[rezzza/accounting

Accounting utilities

2315.3k](/packages/rezzza-accounting)

PHPackages © 2026

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