Repository Details
Shared by
HelloGitHub Rating
0 ratings
Go 语言的时间工具库
Past 7 days Received -1 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 4,716 | — |
| 周三 | 4,716 | 0 |
| 周四 | 4,716 | 0 |
| 周五 | 4,715 | -1 |
| 周六 | 4,715 | 0 |
| 周日 | 4,715 | 0 |
| 周一 | 4,715 | 0 |
4.7k
Stars
No
Chinese
Go
Language
No
Active
21
Contributors
24
Issues
No
Organization
None
Latest
247
Forks
MIT
License
Go 语言的时间工具库。项目简单、代码易懂,示例代码丰富:
```go
import "github.com/jinzhu/now"
time.Now() // 2013-11-18 17:51:49.123456789 Mon
now.BeginningOfMinute() // 2013-11-18 17:51:00 Mon
now.BeginningOfHour() // 2013-11-18 17:00:00 Mon
now.BeginningOfDay() // 2013-11-18 00:00:00 Mon
now.BeginningOfWeek() // 2013-11-17 00:00:00 Sun
now.BeginningOfMonth() // 2013-11-01 00:00:00 Fri
now.BeginningOfQuarter() // 2013-10-01 00:00:00 Tue
now.BeginningOfYear() // 2013-01-01 00:00:00 Tue
now.WeekStartDay = time.Monday // Set Monday as first day, default is Sunday
now.BeginningOfWeek() // 2013-11-18 00:00:00 Mon
now.EndOfMinute() // 2013-11-18 17:51:59.999999999 Mon
now.EndOfHour() // 2013-11-18 17:59:59.999999999 Mon
now.EndOfDay() // 2013-11-18 23:59:59.999999999 Mon
now.EndOfWeek() // 2013-11-23 23:59:59.999999999 Sat
now.EndOfMonth() // 2013-11-30 23:59:59.999999999 Sat
now.EndOfQuarter() // 2013-12-31 23:59:59.999999999 Tue
now.EndOfYear() // 2013-12-31 23:59:59.999999999 Tue
now.WeekStartDay = time.Monday // Set Monday as first day, default is Sunday
now.EndOfWeek() // 2013-11-24 23:59:59.999999999 Sun
```
Included in:
Vol.54
Comments
Rating:
No comments yet