diff --git a/callback_create.go b/callback_create.go index e1b739e5..2f641b3d 100644 --- a/callback_create.go +++ b/callback_create.go @@ -13,8 +13,9 @@ func BeforeCreate(scope *Scope) { func UpdateTimeStampWhenCreate(scope *Scope) { if !scope.HasError() { - scope.SetColumn("CreatedAt", time.Now()) - scope.SetColumn("UpdatedAt", time.Now()) + now := time.Now() + scope.SetColumn("CreatedAt", now) + scope.SetColumn("UpdatedAt", now) } }