kmlpandey77/ndate
最新稳定版本:0.1.4
Composer 安装命令:
composer require kmlpandey77/ndate
包简介
Nepali date converter
README 文档
README
A PHP library for AD to BS and BS to AD
Install
Run the following command from you terminal:
composer require kmlpandey77/ndate
Usage
AD to BS
use Kmlpandey77\Ndate\Ndate; # Example 01 $date_to_bs = Ndate::to_bs("2023-11-08"); echo $date_to_bs // OUTPUT: 2080-07-22 echo $date_to_bs->lang(Ndate::NP) // OUTPUT: २०८०-०७-२२ # Example 02 $date_to_bs = Ndate::to_bs("2023-11-08", 'd/m/Y'); echo $date_to_bs // OUTPUT: 22/07/2080 echo $date_to_bs->format('l, d M, Y') // Wednesday, 22 Kartik, 2080 echo $date_to_bs->format('l, d M, Y')->lang(Ndate::NP) // OUTPUT: बुधवार, २२ कार्तिक, २०८०
Available Date Format
| Format | Description | Example |
|---|---|---|
d |
Day of the month, 2 digits with leading zeros | 01 to 32 |
D |
A textual representation of a day, three letters | Mon for Monday |
j |
Day of the month without leading zeros | 1 to 31 |
l |
A full textual representation of the day of the week | Monday, Tuesday |
m |
Numeric representation of a month, with leading zeros | 01 to 12 |
M |
A full textual representation of a month | Baishak, Jestha |
n |
Numeric representation of a month, without leading zeros | 1 to 12 |
Y |
A full numeric representation of a year, 4 digits | 2078 |
BS to AD
use Kmlpandey77\Ndate\Ndate; # Example 01 $date_to_ad = Ndate::to_ad("2080-07-22"); echo $date_to_ad // OUTPUT: 2023-11-08 # Example 02 $date_to_ad = Ndate::to_ad("2080-07-22", 'd/m/Y'); echo $date_to_ad // OUTPUT: 08/11/2023
统计信息
- 总下载量: 3.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-13