Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Apr 12, 2022
1 parent e75e5e5 commit bc2bef0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func CreateFromDateTimeNano(year, month, day, hour, minute, second, nanosecond i
// CreateFromDate creates a Carbon instance from a given date.
// 从给定的年月日创建 Carbon 实例
func (c Carbon) CreateFromDate(year, month, day int, timezone ...string) Carbon {
now := c.Now()
now := c.Now(timezone...)
hour, minute, second := now.Time()
return c.create(year, month, day, hour, minute, second, now.Nanosecond(), timezone...)
}
Expand All @@ -145,7 +145,7 @@ func CreateFromDate(year, month, day int, timezone ...string) Carbon {
// CreateFromTime creates a Carbon instance from a given time.
// 从给定的时分秒创建 Carbon 实例
func (c Carbon) CreateFromTime(hour, minute, second int, timezone ...string) Carbon {
now := c.Now()
now := c.Now(timezone...)
year, month, day := now.Date()
return c.create(year, month, day, hour, minute, second, now.Nanosecond(), timezone...)
}
Expand Down

0 comments on commit bc2bef0

Please sign in to comment.