PHPackages                             phattarachai/thaidate - 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. phattarachai/thaidate

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

phattarachai/thaidate
=====================

A Laravel, PHP package for thaidate() function

12.1(4y ago)1239.5k—2.6%61MITPHPPHP ^7.3|^8.0

Since Feb 25Pushed 2y ago2 watchersCompare

[ Source](https://github.com/phattarachai/thaidate)[ Packagist](https://packagist.org/packages/phattarachai/thaidate)[ Docs](https://phattarachai.dev)[ RSS](/packages/phattarachai-thaidate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (1)

[![test](https://github.com/phattarachai/thaidate/actions/workflows/php.yml/badge.svg)](https://github.com/phattarachai/thaidate/actions/workflows/php.yml/badge.svg)[![Packagist](https://camo.githubusercontent.com/318ed9e20d6d756615d2273175bb902f510a5e5337ceee110ee2149eb99f2a77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068617474617261636861692f74686169646174652e737667)](https://github.com/phattarachai/thaidate/releases)[![Maintainability](https://camo.githubusercontent.com/1d682d99e1752cee976bcf8c5df7546061903ada811de02b4fdaeac1296f2b45/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38363633373935373135343138313239363066362f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/phattarachai/thaidate/maintainability)

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

[](#-installation)

```
composer require phattarachai/thaidate

```

 thaidate() function
========================================================

[](#-thaidate-function)

Display date in Thai using the same PHP built-in [date()](https://www.php.net/manual/en/function.date.php)function attributes. The date format is as same as [PHP Datetime Format](https://www.php.net/manual/en/datetime.format.php).

Default Format `j F Y`:

```
echo thaidate();
// 25 กุมภาพันธ์ 2564
```

With PHP Date Format:

```
echo thaidate('วันlที่ j F พ.ศ.Y เวลา H:i:s');
// results: วันพฤหัสบดีที่ 25 กุมภาพันธ์ พ.ศ.2564 เวลา 23:55:29
```

Laravel Carbon Usage
====================

[](#laravel-carbon-usage)

You can also use `thaidate()` function directly from Laravel carbon instance. It uses Laravel macro feature to add the functionality as a carbon method.

```
use Illuminate\Support\Carbon;

Carbon::parse('2021-02-25')->thaidate();
// 25 กุมภาพันธ์ 2564

Carbon::parse('2021-02-25')->thaidate('D j M y');
// พฤ. 25 ก.พ. 64
```

This means you can use thaidate() directly from an Eloquent model attributes that is a date attribute as well.

```
$user->created_at->thaidate();
// 25 กุมภาพันธ์ 2564
```

ผู้พัฒนา
--------

[](#ผู้พัฒนา)

🙋‍♂️ สวัสดีครับ ผมอ๊อฟนะครับ เป็น Full Stack Web Developer รับ Implement งาน Project ทางด้าน Web Application สำหรับองค์กร ธุรกิจ SME ส่วนงานราชการและบริษัทขนาดใหญ่ครับ

line: [phat-chai](https://line.me/ti/p/~phat-chai)

License
-------

[](#license)

The MIT License (MIT)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~17 days

Recently: every ~24 days

Total

7

Last Release

1806d ago

Major Versions

1.2.1 → 12.12021-06-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0c26146c11d937355b3e1e6b2f83dbe74320e51623dfde506a6e460077e789a?d=identicon)[phatchai](/maintainers/phatchai)

---

Top Contributors

[![phattarachai](https://avatars.githubusercontent.com/u/2162876?v=4)](https://github.com/phattarachai "phattarachai (30 commits)")

---

Tags

laravelphpthaidate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phattarachai-thaidate/health.svg)

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

PHPackages © 2026

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