From 7f2967ad8ef4fae0fae330328f9974880b3fbce4 Mon Sep 17 00:00:00 2001 From: gouguoyin <245629560@qq.com> Date: Tue, 6 Jul 2021 07:11:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- carbon.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/carbon.go b/carbon.go index 0ff388c..ea9f007 100755 --- a/carbon.go +++ b/carbon.go @@ -145,7 +145,7 @@ type Carbon struct { Error error } -// New 新建 Carbon +// New 新建 Carbon 结构体 func New() Carbon { return Carbon{Loc: time.Local, Lang: NewLanguage()} } @@ -191,7 +191,7 @@ func Tomorrow() Carbon { // Yesterday 昨天 func (c Carbon) Yesterday() Carbon { if c.IsZero() { - c.Time = time.Now().AddDate(0, 0, -1) + c.Time = time.Now().In(c.Loc).AddDate(0, 0, -1) } else { c.Time = c.Time.In(c.Loc).AddDate(0, 0, -1) }