代码拉取完成,页面将自动刷新
同步操作将从 dromara/carbon 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
// @Package carbon
// @Description a simple, semantic and developer-friendly time package for golang
// @Page github.com/dromara/carbon
// @Developer gouguoyin
// @Blog www.gouguoyin.com
// @Email 245629560@qq.com
// Package carbon is a simple, semantic and developer-friendly time package for golang.
package carbon
import (
"time"
)
type StdTime = time.Time
type Weekday = time.Weekday
type Location = time.Location
type Duration = time.Duration
// Carbon defines a Carbon struct.
// 定义 Carbon 结构体
type Carbon struct {
layout string
time StdTime
weekStartsAt Weekday
weekendDays []Weekday
loc *Location
lang *Language
Error error
}
// NewCarbon returns a new Carbon instance.
// 返回 Carbon 实例
func NewCarbon(time ...StdTime) *Carbon {
c := new(Carbon)
c.lang = NewLanguage().SetLocale(DefaultLocale)
c.layout = DefaultLayout
c.weekStartsAt = DefaultWeekStartsAt
c.weekendDays = DefaultWeekendDays
if len(time) > 0 {
c.time = time[0]
c.loc = c.time.Location()
return c
}
c.loc, c.Error = parseTimezone(DefaultTimezone)
return c
}
// Copy returns a new copy of the current Carbon instance
// 复制 Carbon 实例
func (c *Carbon) Copy() *Carbon {
newCarbon := NewCarbon()
newCarbon.time = time.Date(c.Year(), time.Month(c.Month()), c.Day(), c.Hour(), c.Minute(), c.Second(), c.Nanosecond(), c.loc)
newCarbon.layout = c.layout
newCarbon.weekStartsAt = c.weekStartsAt
newCarbon.weekendDays = c.weekendDays
newCarbon.loc = c.loc
newCarbon.Error = c.Error
newCarbon.lang.dir = c.lang.dir
newCarbon.lang.locale = c.lang.locale
newCarbon.lang.resources = c.lang.resources
newCarbon.lang.Error = c.lang.Error
return newCarbon
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。