Skip to content

Commit

Permalink
Move ToStdTime method from carbon.go to outputer.go
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Sep 6, 2023
1 parent 1e670b2 commit 9a32a60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions outputer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"strconv"
"strings"
"time"
)

// String implements the interface Stringer for Carbon struct.
Expand Down Expand Up @@ -788,3 +789,9 @@ func (c Carbon) ToFormatString(format string, timezone ...string) string {
func (c Carbon) Format(format string, timezone ...string) string {
return c.ToFormatString(format, timezone...)
}

// ToStdTime converts Carbon to standard time.Time.
// 将 Carbon 转换成标准 time.Time
func (c Carbon) ToStdTime() time.Time {
return c.time.In(c.loc)
}

0 comments on commit 9a32a60

Please # to comment.