定制 phattarachai/thaidate 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phattarachai/thaidate

最新稳定版本:12.1

Composer 安装命令:

composer require phattarachai/thaidate

包简介

A Laravel, PHP package for thaidate() function

README 文档

README

test Packagist Maintainability

Installation

composer require phattarachai/thaidate

thaidate() function

Display date in Thai using the same PHP built-in date() function attributes. The date format is as same as PHP Datetime Format.

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

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 ส่วนงานราชการและบริษัทขนาดใหญ่ครับ
https://phattarachai.dev

line: phat-chai

License

The MIT License (MIT)

统计信息

  • 总下载量: 37.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-25