carbon/deprecated.go
2023-09-08 17:56:41 +08:00

30 lines
996 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// The functions and methods in this file will be removed in the future
package carbon
import "time"
// Deprecated: It will be removed in the future, use CreateFromStdTime instead.
//
// FromStdTime converts standard time.Time to Carbon.
// 将标准 time.Time 转换成 Carbon未来将移除请使用 CreateFromStdTime 替代
func FromStdTime(tt time.Time) Carbon {
return CreateFromStdTime(tt)
}
// Deprecated: It will be removed in the future, use CreateFromStdTime instead.
//
// Time2Carbon converts standard time.Time to Carbon.
// 将标准 time.Time 转换成 Carbon未来将移除请使用 CreateFromStdTime 替代
func Time2Carbon(tt time.Time) Carbon {
return CreateFromStdTime(tt)
}
// Deprecated: It will be removed in the future, use ToStdTime instead.
//
// Carbon2Time converts Carbon to standard time.Time.
// 将 Carbon 转换成标准 time.Time未来将移除请使用 ToStdTime 替代
func (c Carbon) Carbon2Time() time.Time {
return c.ToStdTime()
}