Skip to content

Commit

Permalink
Remove deprecated method ToStdTime
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Nov 29, 2024
1 parent bdb0cf0 commit eb6466d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
9 changes: 0 additions & 9 deletions outputer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"strconv"
"strings"
"time"
)

// String implements the interface Stringer for Carbon struct.
Expand Down Expand Up @@ -891,11 +890,3 @@ func (c Carbon) Format(format string, timezone ...string) string {
}
return buffer.String()
}

// Deprecated: it will be removed in the future, use StdTime instead.
//
// ToStdTime converts Carbon to standard time.Time.
// 将 Carbon 转换成标准 time.Time
func (c Carbon) ToStdTime() time.Time {
return c.StdTime()
}
7 changes: 0 additions & 7 deletions outputer_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package carbon
import (
"github.com/stretchr/testify/assert"
"testing"
"time"
)

func TestCarbon_String(t *testing.T) {
Expand Down Expand Up @@ -2646,12 +2645,6 @@ func TestCarbon_Format(t *testing.T) {
}
}

func TestCarbon_ToStdTime(t *testing.T) {
expected := time.Now().Format(DateTimeFormat)
actual := Now().ToStdTime().Format(DateTimeFormat)
assert.Equal(t, expected, actual)
}

// https://github.com/dromara/carbon/issues/200
func TestCarbon_Issue200(t *testing.T) {
tests1 := []struct {
Expand Down

0 comments on commit eb6466d

Please sign in to comment.