Skip to content

Commit

Permalink
Update content
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Sep 26, 2023
1 parent e927e1d commit c36a853
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ type Person struct {
GraduatedAt2 carbon.DateMilli `json:"graduated_at"`
GraduatedAt3 carbon.DateMicro `json:"graduated_at"`
GraduatedAt4 carbon.DateNano `json:"graduated_at"`
OperatedAt1 carbon.Time `json:"operated_at1"`
OperatedAt1 carbon.Time `json:"operated_at1"`
OperatedAt2 carbon.TimeMilli `json:"operated_at2"`
OperatedAt3 carbon.TimeMicro `json:"operated_at3"`
OperatedAt4 carbon.TimeNano `json:"operated_at4"`
Expand All @@ -1259,6 +1259,31 @@ type Person struct {

###### 实例化模型

```go
person := Person {
Name: "gouguoyin",
Age: 18,
Birthday1: carbon.DateTime(carbon.Now().SubYears(18)),
Birthday2: carbon.DateTimeMilli(carbon.Now().SubYears(18)),
Birthday3: carbon.DateTimeMicro(carbon.Now().SubYears(18)),
Birthday4: carbon.DateTimeNano(carbon.Now().SubYears(18)),
GraduatedAt1: carbon.Date(carbon.Now()),
GraduatedAt2: carbon.DateMilli(carbon.Now()),
GraduatedAt3: carbon.DateMicro(carbon.Now()),
GraduatedAt4: carbon.DateNano(carbon.Now()),
OperatedAt1: carbon.Time(carbon.Now()),
OperatedAt2: carbon.TimeMilli(carbon.Now()),
OperatedAt3: carbon.TimeMicro(carbon.Now()),
OperatedAt4: carbon.TimeNano(carbon.Now()),
CreatedAt1: carbon.Timestamp(carbon.Now()),
CreatedAt2: carbon.TimestampMilli(carbon.Now()),
CreatedAt3: carbon.TimestampMicro(carbon.Now()),
CreatedAt4: carbon.TimestampNano(carbon.Now()),
}
```


```go
person := Person {
Name: "gouguoyin",
Expand All @@ -1280,7 +1305,6 @@ person := Person {
CreatedAt3: carbon.Now().ToTimestampMicroStruct(),
CreatedAt4: carbon.Now().ToTimestampNanoStruct(),
}

```

###### JSON 编码
Expand Down
24 changes: 24 additions & 0 deletions README.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,30 @@ type Person struct {
```

###### 初期化モデル
```go
person := Person {
Name: "gouguoyin",
Age: 18,
Birthday1: carbon.DateTime(carbon.Now().SubYears(18)),
Birthday2: carbon.DateTimeMilli(carbon.Now().SubYears(18)),
Birthday3: carbon.DateTimeMicro(carbon.Now().SubYears(18)),
Birthday4: carbon.DateTimeNano(carbon.Now().SubYears(18)),
GraduatedAt1: carbon.Date(carbon.Now()),
GraduatedAt2: carbon.DateMilli(carbon.Now()),
GraduatedAt3: carbon.DateMicro(carbon.Now()),
GraduatedAt4: carbon.DateNano(carbon.Now()),
OperatedAt1: carbon.Time(carbon.Now()),
OperatedAt2: carbon.TimeMilli(carbon.Now()),
OperatedAt3: carbon.TimeMicro(carbon.Now()),
OperatedAt4: carbon.TimeNano(carbon.Now()),
CreatedAt1: carbon.Timestamp(carbon.Now()),
CreatedAt2: carbon.TimestampMilli(carbon.Now()),
CreatedAt3: carbon.TimestampMicro(carbon.Now()),
CreatedAt4: carbon.TimestampNano(carbon.Now()),
}
```

または

```go
person := Person {
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,30 @@ type Person struct {
```

###### Instantiate model
```go
person := Person {
Name: "gouguoyin",
Age: 18,
Birthday1: carbon.DateTime(carbon.Now().SubYears(18)),
Birthday2: carbon.DateTimeMilli(carbon.Now().SubYears(18)),
Birthday3: carbon.DateTimeMicro(carbon.Now().SubYears(18)),
Birthday4: carbon.DateTimeNano(carbon.Now().SubYears(18)),
GraduatedAt1: carbon.Date(carbon.Now()),
GraduatedAt2: carbon.DateMilli(carbon.Now()),
GraduatedAt3: carbon.DateMicro(carbon.Now()),
GraduatedAt4: carbon.DateNano(carbon.Now()),
OperatedAt1: carbon.Time(carbon.Now()),
OperatedAt2: carbon.TimeMilli(carbon.Now()),
OperatedAt3: carbon.TimeMicro(carbon.Now()),
OperatedAt4: carbon.TimeNano(carbon.Now()),
CreatedAt1: carbon.Timestamp(carbon.Now()),
CreatedAt2: carbon.TimestampMilli(carbon.Now()),
CreatedAt3: carbon.TimestampMicro(carbon.Now()),
CreatedAt4: carbon.TimestampNano(carbon.Now()),
}
```

or

```go
person := Person {
Expand Down

0 comments on commit c36a853

Please sign in to comment.