Skip to content

Commit

Permalink
Add description of IsDST method
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Nov 6, 2023
1 parent 61dbd48 commit 04939db
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
12 changes: 10 additions & 2 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

简体中文 | [English](README.md) | [日本語](README.jp.md)

一个轻量级、语义化、零依赖、对开发者友好的 golang
时间处理库,支持链式调用,已被 [awesome-go-cn](https://github.com/yinggaozhen/awesome-go-cn#日期和时间 "awesome-go-cn") 收录
一个轻量级、语义化、对开发者友好的 golang 时间处理库,支持链式调用,已被 [awesome-go-cn](https://github.com/yinggaozhen/awesome-go-cn#日期和时间 "awesome-go-cn") 收录

[github.com/golang-module/carbon](https://github.com/golang-module/carbon "github.com/golang-module/carbon")

Expand Down Expand Up @@ -543,6 +542,15 @@ carbon.Parse("2022-08-05 13:14:15").DiffForHumans(carbon.Now()) // 2 years after
##### 时间判断

```go
// 是否是夏令时
carbon.Parse("").IsDST() // false
carbon.Parse("0").IsDST() // false
carbon.Parse("0000-00-00 00:00:00").IsDST() // false
carbon.Parse("0000-00-00").IsDST() // false
carbon.Parse("00:00:00").IsDST() // false
carbon.Parse("2023-01-01", "Australia/Brisbane").IsDST() // false
carbon.Parse("2023-01-01", "Australia/Sydney").IsDST() // true

// 是否是零值时间
carbon.Parse("").IsZero() // true
carbon.Parse("0").IsZero() // true
Expand Down
13 changes: 11 additions & 2 deletions README.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

日本語 | [English](README.md) | [简体中文](README.cn.md)

軽量、セマンティック、依存性ゼロ、開発者に優しい golang 時間処理ライブラリ
軽量でセマンティックで開発者に優しい golang 時間処理ライブラリ

Carbon は [awesome-go](https://github.com/avelino/awesome-go#date-and-time "awesome-go") に収録されています, よかったら, スターをください

Expand Down Expand Up @@ -542,7 +542,16 @@ carbon.Parse("2022-08-05 13:14:15").DiffForHumans(carbon.Now()) // 2 years after
##### 时间比較

```go
// ゼロ時間ですか
// 夏時間ですか
carbon.Parse("").IsDST() // false
carbon.Parse("0").IsDST() // false
carbon.Parse("0000-00-00 00:00:00").IsDST() // false
carbon.Parse("0000-00-00").IsDST() // false
carbon.Parse("00:00:00").IsDST() // false
carbon.Parse("2023-01-01", "Australia/Brisbane").IsDST() // false
carbon.Parse("2023-01-01", "Australia/Sydney").IsDST() // true

// ゼロ値の時間ですか
carbon.Parse("").IsZero() // true
carbon.Parse("0").IsZero() // true
carbon.Parse("0000-00-00 00:00:00").IsZero() // true
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ English | [简体中文](README.cn.md) | [日本語](README.jp.md)

#### Introduction

A simple, semantic, zero dependency and developer-friendly golang package for datetime, has been included
A simple, semantic and developer-friendly golang package for datetime, has been included
by [awesome-go](https://github.com/avelino/awesome-go#date-and-time "awesome-go")

[github.com/golang-module/carbon](https://github.com/golang-module/carbon "github.com/golang-module/carbon")
Expand Down Expand Up @@ -539,6 +539,15 @@ carbon.Parse("2022-08-05 13:14:15").DiffForHumans(carbon.Now()) // 2 years after
##### Comparison

```go
// whether is daylight saving time
carbon.Parse("").IsDST() // false
carbon.Parse("0").IsDST() // false
carbon.Parse("0000-00-00 00:00:00").IsDST() // false
carbon.Parse("0000-00-00").IsDST() // false
carbon.Parse("00:00:00").IsDST() // false
carbon.Parse("2023-01-01", "Australia/Brisbane").IsDST() // false
carbon.Parse("2023-01-01", "Australia/Sydney").IsDST() // true

// Whether is zero time
carbon.Parse("").IsZero() // true
carbon.Parse("0").IsZero() // true
Expand Down

0 comments on commit 04939db

Please sign in to comment.