Skip to content

Commit b33937e

Browse files
committed
更新文档
1 parent 1782ddc commit b33937e

File tree

2 files changed

+57
-28
lines changed

2 files changed

+57
-28
lines changed

README.md

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
1-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/zjkal/time-helper/.github/workflows/php.yml?branch=main)](https://github.com/zjkal/time-helper/actions)
2-
[![PHP Version Require](http://poser.pugx.org/zjkal/time-helper/require/php)](https://packagist.org/packages/zjkal/time-helper)
3-
[![Latest Stable Version](http://poser.pugx.org/zjkal/time-helper/v)](https://packagist.org/packages/zjkal/time-helper)
4-
[![Latest Unstable Version](http://poser.pugx.org/zjkal/time-helper/v/unstable)](https://packagist.org/packages/zjkal/time-helper)
5-
[![License](http://poser.pugx.org/zjkal/time-helper/license)](https://packagist.org/packages/zjkal/time-helper)
6-
[![Total Downloads](http://poser.pugx.org/zjkal/time-helper/downloads)](https://packagist.org/packages/zjkal/time-helper)
7-
8-
**中文文档 | [English Document](https://github.com/zjkal/time-helper/blob/main/README.en.md)**
9-
10-
# TimeHelper - 最方便的PHP时间助手类库
11-
12-
### ⭐ 请不要吝啬您的小星星, 您的认可才是我继续前行的动力 ⭐
13-
14-
### 特色:
15-
1. **化繁为简**: 所有方法都可以传入任意类型的时间日期格式或者时间戳
16-
2. **快捷高效**: 所有操作都是只需要一个静态方法即可实现
17-
3. **长期维护**: 作者为自由职业者,保证项目的长期稳定
18-
19-
#### 使用过程中发现BUG或者任何建议,请[提交Issues](https://github.com/zjkal/time-helper/issues)[QQ群交流](https://jq.qq.com/?_wv=1027&k=pI1Ky6fD)
20-
21-
# 通过Composer导入类库
22-
1+
<br/>
2+
<div align="center">
3+
<img src="logo.svg" alt="TimeHelper" width="240" />
4+
<br/>
5+
中文文档 |
6+
<a href="https://github.com/zjkal/time-helper/blob/main/README.en.md" target="_blank">English Document</a>
7+
</div>
8+
<br/>
9+
<p align="center">
10+
<a href="https://github.com/zjkal/time-helper" target="_blank">
11+
<img src="https://img.shields.io/github/actions/workflow/status/zjkal/time-helper/.github/workflows/php.yml?branch=main" alt="GitHub Workflow Status">
12+
</a>
13+
<a href="https://github.com/zjkal/time-helper" target="_blank">
14+
<img src="https://poser.pugx.org/zjkal/time-helper/require/php" alt="PHP Version Require">
15+
</a>
16+
<a href="https://github.com/zjkal/time-helper" target="_blank">
17+
<img src="https://poser.pugx.org/zjkal/time-helper/v" alt="Latest Stable Version">
18+
</a>
19+
<a href="https://github.com/zjkal/time-helper/blob/main/LICENSE" target="_blank">
20+
<img src="https://poser.pugx.org/zjkal/time-helper/license" alt="License">
21+
</a>
22+
<a href="https://github.com/zjkal/time-helper" target="_blank">
23+
<img src="https://img.shields.io/github/stars/zjkal/time-helper" alt="GitHub Repo stars">
24+
</a>
25+
<a href="https://packagist.org/packages/zjkal/time-helper" target="_blank">
26+
<img src="https://poser.pugx.org/zjkal/time-helper/downloads" alt="Total Downloads">
27+
</a>
28+
</p>
29+
<br/>
30+
31+
## 简介
32+
33+
`TimeHelper` 是一个简单易用的`PHP`
34+
时间日期助手类库,可以快速实现常用的时间日期操作,比如获取指定时间的秒数,获取友好的时间格式,判断时间范围,计算两个时间相差值,返回N小时/天/星期/月/年前或者后的时间戳等等
35+
36+
## 特性
37+
38+
- **简单易用**: 不依赖任何扩展,`开箱即用`
39+
- **化繁为简**: 所有方法都可以传入`任意类型的时间日期格式``时间戳`
40+
- **快捷高效**: 所有操作只需要`一个静态方法`即可完成
41+
- **长期维护**: 作者为自由职业者,保证项目的`长期稳定``持续更新`
42+
43+
## 安装使用
44+
45+
- 通过Composer导入类库
2346
```bash
2447
composer require zjkal/time-helper
2548
```
2649

27-
# 使用方法
50+
## 使用文档
2851

2952
首先在类中引用TimeHelper助手类
3053

@@ -203,9 +226,11 @@ TimeHelper::daysInYear(1646360133);
203226
TimeHelper::daysInMonth('Apr 11, 2020');
204227
```
205228

206-
### 9.国内节假日/工作日相关 🆕
229+
### 9.国内节假日/工作日相关 🆕
230+
207231
*专门针对国内的节假日进行判断,目前包含2020年-2023年的节假日数据,后续也会持续更新.*
208232
*为了便于维护,另起了一个类ChinaHoliday,同样可以传入任意类型的时间格式或时间戳*
233+
209234
```php
210235
use zjkal\ChinaHoliday;
211236

@@ -216,9 +241,11 @@ ChinaHoliday::isWorkday('2023-01-23');
216241
ChinaHoliday::isHoliday(1646360133);
217242
```
218243

219-
> **特别说明**: 所有时间的方法都可以传入任意格式的时间或者时间戳, 但是有一点请注意 m/d/y 或 d-m-y 格式的日期,如果分隔符是斜线(/),则使用美洲的 m/d/y 格式。如果分隔符是横杠(-)或者点(.),则使用欧洲的 d-m-y 格式。为了避免潜在的错误,您应该尽可能使用 YYYY-MM-DD 格式或其他格式.
244+
> **特别说明**: 所有时间的方法都可以传入任意格式的时间或者时间戳, 但是有一点请注意 m/d/y 或 d-m-y
245+
> 格式的日期,如果分隔符是斜线(/),则使用美洲的 m/d/y 格式。如果分隔符是横杠(-)或者点(.),则使用欧洲的 d-m-y
246+
> 格式。为了避免潜在的错误,您应该尽可能使用 YYYY-MM-DD 格式或其他格式.
220247
221-
# 更新日志
248+
## 更新日志
222249

223250
<details><summary>点击查看更新日志</summary>
224251

@@ -268,6 +295,7 @@ ChinaHoliday::isHoliday(1646360133);
268295
> * 从tp-helper的时间类中独立出来
269296
</details>
270297
271-
# 开源协议
298+
## 开源协议
272299

273-
TimeHelper遵循[MIT](https://github.com/zjkal/time-helper/blob/main/LICENSE)开源协议, 意味着您无需任何授权, 即可免费将TimeHelper应用到您的项目中
300+
TimeHelper遵循[MIT](https://github.com/zjkal/time-helper/blob/main/LICENSE)开源协议, 意味着您无需任何授权,
301+
即可免费将TimeHelper应用到您的项目中

logo.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)