Documentation ¶
Overview ¶
Package carbon is a simple, semantic and developer-friendly golang package for datetime.
Index ¶
- Constants
- func SetDefault(d Default)
- type Carbon
- func CreateFromDate(year, month, day int, timezone ...string) Carbon
- func CreateFromDateMicro(year, month, day, microsecond int, timezone ...string) Carbon
- func CreateFromDateMilli(year, month, day, millisecond int, timezone ...string) Carbon
- func CreateFromDateNano(year, month, day, nanosecond int, timezone ...string) Carbon
- func CreateFromDateTime(year, month, day, hour, minute, second int, timezone ...string) Carbon
- func CreateFromDateTimeMicro(year, month, day, hour, minute, second, microsecond int, timezone ...string) Carbon
- func CreateFromDateTimeMilli(year, month, day, hour, minute, second, millisecond int, timezone ...string) Carbon
- func CreateFromDateTimeNano(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Carbon
- func CreateFromJulian(f float64) Carbon
- func CreateFromLunar(year, month, day, hour, minute, second int, isLeapMonth bool) Carbon
- func CreateFromPersian(year, month, day, hour, minute, second int) (c Carbon)
- func CreateFromStdTime(tt time.Time, timezone ...string) Carbon
- func CreateFromTime(hour, minute, second int, timezone ...string) Carbon
- func CreateFromTimeMicro(hour, minute, second, microsecond int, timezone ...string) Carbon
- func CreateFromTimeMilli(hour, minute, second, millisecond int, timezone ...string) Carbon
- func CreateFromTimeNano(hour, minute, second, nanosecond int, timezone ...string) Carbon
- func CreateFromTimestamp(timestamp int64, timezone ...string) Carbon
- func CreateFromTimestampMicro(timestamp int64, timezone ...string) Carbon
- func CreateFromTimestampMilli(timestamp int64, timezone ...string) Carbon
- func CreateFromTimestampNano(timestamp int64, timezone ...string) Carbon
- func Max(c1 Carbon, c2 ...Carbon) (c Carbon)
- func MaxValue() Carbon
- func Min(c1 Carbon, c2 ...Carbon) (c Carbon)
- func MinValue() Carbon
- func NewCarbon() Carbon
- func Now(timezone ...string) Carbon
- func Parse(value string, timezone ...string) Carbon
- func ParseByFormat(value, format string, timezone ...string) Carbon
- func ParseByLayout(value, layout string, timezone ...string) Carbon
- func SetLanguage(lang *Language) Carbon
- func SetLocale(locale string) Carbon
- func SetLocation(loc *time.Location) Carbon
- func SetTimezone(name string) Carbon
- func SetWeekStartsAt(day string) Carbon
- func Tomorrow(timezone ...string) Carbon
- func Yesterday(timezone ...string) Carbon
- func (c Carbon) AddCenturies(centuries int) Carbon
- func (c Carbon) AddCenturiesNoOverflow(centuries int) Carbon
- func (c Carbon) AddCentury() Carbon
- func (c Carbon) AddCenturyNoOverflow() Carbon
- func (c Carbon) AddDay() Carbon
- func (c Carbon) AddDays(days int) Carbon
- func (c Carbon) AddDecade() Carbon
- func (c Carbon) AddDecadeNoOverflow() Carbon
- func (c Carbon) AddDecades(decades int) Carbon
- func (c Carbon) AddDecadesNoOverflow(decades int) Carbon
- func (c Carbon) AddDuration(duration string) Carbon
- func (c Carbon) AddHour() Carbon
- func (c Carbon) AddHours(hours int) Carbon
- func (c Carbon) AddMicrosecond() Carbon
- func (c Carbon) AddMicroseconds(microseconds int) Carbon
- func (c Carbon) AddMillisecond() Carbon
- func (c Carbon) AddMilliseconds(milliseconds int) Carbon
- func (c Carbon) AddMinute() Carbon
- func (c Carbon) AddMinutes(minutes int) Carbon
- func (c Carbon) AddMonth() Carbon
- func (c Carbon) AddMonthNoOverflow() Carbon
- func (c Carbon) AddMonths(months int) Carbon
- func (c Carbon) AddMonthsNoOverflow(months int) Carbon
- func (c Carbon) AddNanosecond() Carbon
- func (c Carbon) AddNanoseconds(nanoseconds int) Carbon
- func (c Carbon) AddQuarter() Carbon
- func (c Carbon) AddQuarterNoOverflow() Carbon
- func (c Carbon) AddQuarters(quarters int) Carbon
- func (c Carbon) AddQuartersNoOverflow(quarters int) Carbon
- func (c Carbon) AddSecond() Carbon
- func (c Carbon) AddSeconds(seconds int) Carbon
- func (c Carbon) AddWeek() Carbon
- func (c Carbon) AddWeeks(weeks int) Carbon
- func (c Carbon) AddYear() Carbon
- func (c Carbon) AddYearNoOverflow() Carbon
- func (c Carbon) AddYears(years int) Carbon
- func (c Carbon) AddYearsNoOverflow(years int) Carbon
- func (c Carbon) Age() int
- func (c Carbon) Between(start Carbon, end Carbon) bool
- func (c Carbon) BetweenIncludedBoth(start Carbon, end Carbon) bool
- func (c Carbon) BetweenIncludedEnd(start Carbon, end Carbon) bool
- func (c Carbon) BetweenIncludedStart(start Carbon, end Carbon) bool
- func (c Carbon) Century() int
- func (c Carbon) Closest(c1 Carbon, c2 Carbon) Carbon
- func (c Carbon) Compare(operator string, t Carbon) bool
- func (c Carbon) Constellation() string
- func (c Carbon) CreateFromDate(year, month, day int, timezone ...string) Carbon
- func (c Carbon) CreateFromDateMicro(year, month, day, microsecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromDateMilli(year, month, day, millisecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromDateNano(year, month, day, nanosecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromDateTime(year, month, day, hour, minute, second int, timezone ...string) Carbon
- func (c Carbon) CreateFromDateTimeMicro(year, month, day, hour, minute, second, microsecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromDateTimeMilli(year, month, day, hour, minute, second, millisecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromDateTimeNano(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromTime(hour, minute, second int, timezone ...string) Carbon
- func (c Carbon) CreateFromTimeMicro(hour, minute, second, microsecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromTimeMilli(hour, minute, second, millisecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromTimeNano(hour, minute, second, nanosecond int, timezone ...string) Carbon
- func (c Carbon) CreateFromTimestamp(timestamp int64, timezone ...string) Carbon
- func (c Carbon) CreateFromTimestampMicro(timestamp int64, timezone ...string) Carbon
- func (c Carbon) CreateFromTimestampMilli(timestamp int64, timezone ...string) Carbon
- func (c Carbon) CreateFromTimestampNano(timestamp int64, timezone ...string) Carbon
- func (c Carbon) Date() (year, month, day int)
- func (c Carbon) DateMicro() (year, month, day, microsecond int)
- func (c Carbon) DateMilli() (year, month, day, millisecond int)
- func (c Carbon) DateNano() (year, month, day, nanosecond int)
- func (c Carbon) DateTime() (year, month, day, hour, minute, second int)
- func (c Carbon) DateTimeMicro() (year, month, day, hour, minute, second, microsecond int)
- func (c Carbon) DateTimeMilli() (year, month, day, hour, minute, second, millisecond int)
- func (c Carbon) DateTimeNano() (year, month, day, hour, minute, second, nanosecond int)
- func (c Carbon) Day() int
- func (c Carbon) DayOfMonth() int
- func (c Carbon) DayOfWeek() int
- func (c Carbon) DayOfYear() int
- func (c Carbon) DaysInMonth() int
- func (c Carbon) DaysInYear() int
- func (c Carbon) Decade() int
- func (c Carbon) DiffAbsInDays(carbon ...Carbon) int64
- func (c Carbon) DiffAbsInDuration(carbon ...Carbon) time.Duration
- func (c Carbon) DiffAbsInHours(carbon ...Carbon) int64
- func (c Carbon) DiffAbsInMinutes(carbon ...Carbon) int64
- func (c Carbon) DiffAbsInMonths(carbon ...Carbon) int64
- func (c Carbon) DiffAbsInSeconds(carbon ...Carbon) int64
- func (c Carbon) DiffAbsInString(carbon ...Carbon) string
- func (c Carbon) DiffAbsInWeeks(carbon ...Carbon) int64
- func (c Carbon) DiffAbsInYears(carbon ...Carbon) int64
- func (c Carbon) DiffForHumans(carbon ...Carbon) string
- func (c Carbon) DiffInDays(carbon ...Carbon) int64
- func (c Carbon) DiffInDuration(carbon ...Carbon) time.Duration
- func (c Carbon) DiffInHours(carbon ...Carbon) int64
- func (c Carbon) DiffInMinutes(carbon ...Carbon) int64
- func (c Carbon) DiffInMonths(carbon ...Carbon) int64
- func (c Carbon) DiffInSeconds(carbon ...Carbon) int64
- func (c Carbon) DiffInString(carbon ...Carbon) string
- func (c Carbon) DiffInWeeks(carbon ...Carbon) int64
- func (c Carbon) DiffInYears(carbon ...Carbon) int64
- func (c Carbon) EndOfCentury() Carbon
- func (c Carbon) EndOfDay() Carbon
- func (c Carbon) EndOfDecade() Carbon
- func (c Carbon) EndOfHour() Carbon
- func (c Carbon) EndOfMinute() Carbon
- func (c Carbon) EndOfMonth() Carbon
- func (c Carbon) EndOfQuarter() Carbon
- func (c Carbon) EndOfSeason() Carbon
- func (c Carbon) EndOfSecond() Carbon
- func (c Carbon) EndOfWeek() Carbon
- func (c Carbon) EndOfYear() Carbon
- func (c Carbon) Eq(t Carbon) bool
- func (c Carbon) Farthest(c1 Carbon, c2 Carbon) Carbon
- func (c Carbon) Format(format string, timezone ...string) string
- func (c Carbon) GoString() string
- func (c Carbon) Gt(t Carbon) bool
- func (c Carbon) Gte(t Carbon) bool
- func (c Carbon) Hour() int
- func (c Carbon) IsAM() bool
- func (c Carbon) IsApril() bool
- func (c Carbon) IsAquarius() bool
- func (c Carbon) IsAries() bool
- func (c Carbon) IsAugust() bool
- func (c Carbon) IsAutumn() bool
- func (c Carbon) IsCancer() bool
- func (c Carbon) IsCapricorn() bool
- func (c Carbon) IsDST() bool
- func (c Carbon) IsDecember() bool
- func (c Carbon) IsFebruary() bool
- func (c Carbon) IsFriday() bool
- func (c Carbon) IsFuture() bool
- func (c Carbon) IsGemini() bool
- func (c Carbon) IsInvalid() bool
- func (c Carbon) IsJanuary() bool
- func (c Carbon) IsJuly() bool
- func (c Carbon) IsJune() bool
- func (c Carbon) IsLeapYear() bool
- func (c Carbon) IsLeo() bool
- func (c Carbon) IsLibra() bool
- func (c Carbon) IsLongYear() bool
- func (c Carbon) IsMarch() bool
- func (c Carbon) IsMay() bool
- func (c Carbon) IsMonday() bool
- func (c Carbon) IsNovember() bool
- func (c Carbon) IsNow() bool
- func (c Carbon) IsOctober() bool
- func (c Carbon) IsPM() bool
- func (c Carbon) IsPast() bool
- func (c Carbon) IsPisces() bool
- func (c Carbon) IsSagittarius() bool
- func (c Carbon) IsSameCentury(t Carbon) bool
- func (c Carbon) IsSameDay(t Carbon) bool
- func (c Carbon) IsSameDecade(t Carbon) bool
- func (c Carbon) IsSameHour(t Carbon) bool
- func (c Carbon) IsSameMinute(t Carbon) bool
- func (c Carbon) IsSameMonth(t Carbon) bool
- func (c Carbon) IsSameQuarter(t Carbon) bool
- func (c Carbon) IsSameSecond(t Carbon) bool
- func (c Carbon) IsSameYear(t Carbon) bool
- func (c Carbon) IsSaturday() bool
- func (c Carbon) IsScorpio() bool
- func (c Carbon) IsSeptember() bool
- func (c Carbon) IsSetTestNow() bool
- func (c Carbon) IsSpring() bool
- func (c Carbon) IsSummer() bool
- func (c Carbon) IsSunday() bool
- func (c Carbon) IsTaurus() bool
- func (c Carbon) IsThursday() bool
- func (c Carbon) IsToday() bool
- func (c Carbon) IsTomorrow() bool
- func (c Carbon) IsTuesday() bool
- func (c Carbon) IsValid() bool
- func (c Carbon) IsVirgo() bool
- func (c Carbon) IsWednesday() bool
- func (c Carbon) IsWeekday() bool
- func (c Carbon) IsWeekend() bool
- func (c Carbon) IsWinter() bool
- func (c Carbon) IsYesterday() bool
- func (c Carbon) IsZero() bool
- func (c Carbon) Julian() (j julian.Julian)
- func (c Carbon) Layout(layout string, timezone ...string) string
- func (c Carbon) Locale() string
- func (c Carbon) Location() string
- func (c Carbon) Lt(t Carbon) bool
- func (c Carbon) Lte(t Carbon) bool
- func (c Carbon) Lunar() (l lunar.Lunar)
- func (c Carbon) MarshalJSON() ([]byte, error)
- func (c Carbon) Microsecond() int
- func (c Carbon) Millisecond() int
- func (c Carbon) Minute() int
- func (c Carbon) Month() int
- func (c Carbon) MonthOfYear() int
- func (c Carbon) Nanosecond() int
- func (c Carbon) Ne(t Carbon) bool
- func (c Carbon) Now(timezone ...string) Carbon
- func (c Carbon) Offset() int
- func (c Carbon) Parse(value string, timezone ...string) Carbon
- func (c Carbon) ParseByFormat(value, format string, timezone ...string) Carbon
- func (c Carbon) ParseByLayout(value, layout string, timezone ...string) Carbon
- func (c Carbon) Persian() (p persian.Persian)
- func (c Carbon) Quarter() (quarter int)
- func (c *Carbon) Scan(src interface{}) error
- func (c Carbon) Season() string
- func (c Carbon) Second() int
- func (c Carbon) SetDate(year, month, day int) Carbon
- func (c Carbon) SetDateMicro(year, month, day, microsecond int) Carbon
- func (c Carbon) SetDateMilli(year, month, day, millisecond int) Carbon
- func (c Carbon) SetDateNano(year, month, day, nanosecond int) Carbon
- func (c Carbon) SetDateTime(year, month, day, hour, minute, second int) Carbon
- func (c Carbon) SetDateTimeMicro(year, month, day, hour, minute, second, microsecond int) Carbon
- func (c Carbon) SetDateTimeMilli(year, month, day, hour, minute, second, millisecond int) Carbon
- func (c Carbon) SetDateTimeNano(year, month, day, hour, minute, second, nanosecond int) Carbon
- func (c Carbon) SetDay(day int) Carbon
- func (c Carbon) SetHour(hour int) Carbon
- func (c Carbon) SetLocale(locale string) Carbon
- func (c Carbon) SetLocation(loc *time.Location) Carbon
- func (c Carbon) SetMicrosecond(microsecond int) Carbon
- func (c Carbon) SetMillisecond(millisecond int) Carbon
- func (c Carbon) SetMinute(minute int) Carbon
- func (c Carbon) SetMonth(month int) Carbon
- func (c Carbon) SetMonthNoOverflow(month int) Carbon
- func (c Carbon) SetNanosecond(nanosecond int) Carbon
- func (c Carbon) SetSecond(second int) Carbon
- func (c *Carbon) SetTestNow(carbon Carbon)
- func (c Carbon) SetTime(hour, minute, second int) Carbon
- func (c Carbon) SetTimeMicro(hour, minute, second, microsecond int) Carbon
- func (c Carbon) SetTimeMilli(hour, minute, second, millisecond int) Carbon
- func (c Carbon) SetTimeNano(hour, minute, second, nanosecond int) Carbon
- func (c Carbon) SetTimezone(name string) Carbon
- func (c Carbon) SetWeekStartsAt(day string) Carbon
- func (c Carbon) SetYear(year int) Carbon
- func (c Carbon) SetYearNoOverflow(year int) Carbon
- func (c Carbon) StartOfCentury() Carbon
- func (c Carbon) StartOfDay() Carbon
- func (c Carbon) StartOfDecade() Carbon
- func (c Carbon) StartOfHour() Carbon
- func (c Carbon) StartOfMinute() Carbon
- func (c Carbon) StartOfMonth() Carbon
- func (c Carbon) StartOfQuarter() Carbon
- func (c Carbon) StartOfSeason() Carbon
- func (c Carbon) StartOfSecond() Carbon
- func (c Carbon) StartOfWeek() Carbon
- func (c Carbon) StartOfYear() Carbon
- func (c Carbon) StdTime() time.Time
- func (c Carbon) String() string
- func (c Carbon) SubCenturies(centuries int) Carbon
- func (c Carbon) SubCenturiesNoOverflow(centuries int) Carbon
- func (c Carbon) SubCentury() Carbon
- func (c Carbon) SubCenturyNoOverflow() Carbon
- func (c Carbon) SubDay() Carbon
- func (c Carbon) SubDays(days int) Carbon
- func (c Carbon) SubDecade() Carbon
- func (c Carbon) SubDecadeNoOverflow() Carbon
- func (c Carbon) SubDecades(decades int) Carbon
- func (c Carbon) SubDecadesNoOverflow(decades int) Carbon
- func (c Carbon) SubDuration(duration string) Carbon
- func (c Carbon) SubHour() Carbon
- func (c Carbon) SubHours(hours int) Carbon
- func (c Carbon) SubMicrosecond() Carbon
- func (c Carbon) SubMicroseconds(microseconds int) Carbon
- func (c Carbon) SubMillisecond() Carbon
- func (c Carbon) SubMilliseconds(milliseconds int) Carbon
- func (c Carbon) SubMinute() Carbon
- func (c Carbon) SubMinutes(minutes int) Carbon
- func (c Carbon) SubMonth() Carbon
- func (c Carbon) SubMonthNoOverflow() Carbon
- func (c Carbon) SubMonths(months int) Carbon
- func (c Carbon) SubMonthsNoOverflow(months int) Carbon
- func (c Carbon) SubNanosecond() Carbon
- func (c Carbon) SubNanoseconds(nanoseconds int) Carbon
- func (c Carbon) SubQuarter() Carbon
- func (c Carbon) SubQuarterNoOverflow() Carbon
- func (c Carbon) SubQuarters(quarters int) Carbon
- func (c Carbon) SubQuartersNoOverflow(quarters int) Carbon
- func (c Carbon) SubSecond() Carbon
- func (c Carbon) SubSeconds(seconds int) Carbon
- func (c Carbon) SubWeek() Carbon
- func (c Carbon) SubWeeks(weeks int) Carbon
- func (c Carbon) SubYear() Carbon
- func (c Carbon) SubYearNoOverflow() Carbon
- func (c Carbon) SubYears(years int) Carbon
- func (c Carbon) SubYearsNoOverflow(years int) Carbon
- func (c Carbon) Time() (hour, minute, second int)
- func (c Carbon) TimeMicro() (hour, minute, second, microsecond int)
- func (c Carbon) TimeMilli() (hour, minute, second, millisecond int)
- func (c Carbon) TimeNano() (hour, minute, second, nanosecond int)
- func (c Carbon) Timestamp() int64
- func (c Carbon) TimestampMicro() int64
- func (c Carbon) TimestampMilli() int64
- func (c Carbon) TimestampNano() int64
- func (c Carbon) Timezone() string
- func (c Carbon) ToAnsicString(timezone ...string) string
- func (c Carbon) ToAtomString(timezone ...string) string
- func (c Carbon) ToCookieString(timezone ...string) string
- func (c Carbon) ToDateMicroString(timezone ...string) string
- func (c Carbon) ToDateMilliString(timezone ...string) string
- func (c Carbon) ToDateNanoString(timezone ...string) string
- func (c Carbon) ToDateString(timezone ...string) string
- func (c Carbon) ToDateTimeMicroString(timezone ...string) string
- func (c Carbon) ToDateTimeMilliString(timezone ...string) string
- func (c Carbon) ToDateTimeNanoString(timezone ...string) string
- func (c Carbon) ToDateTimeString(timezone ...string) string
- func (c Carbon) ToDayDateTimeString(timezone ...string) string
- func (c Carbon) ToFormattedDateString(timezone ...string) string
- func (c Carbon) ToFormattedDayDateString(timezone ...string) string
- func (c Carbon) ToIso8601MicroString(timezone ...string) string
- func (c Carbon) ToIso8601MilliString(timezone ...string) string
- func (c Carbon) ToIso8601NanoString(timezone ...string) string
- func (c Carbon) ToIso8601String(timezone ...string) string
- func (c Carbon) ToIso8601ZuluMicroString(timezone ...string) string
- func (c Carbon) ToIso8601ZuluMilliString(timezone ...string) string
- func (c Carbon) ToIso8601ZuluNanoString(timezone ...string) string
- func (c Carbon) ToIso8601ZuluString(timezone ...string) string
- func (c Carbon) ToKitchenString(timezone ...string) string
- func (c Carbon) ToMonthString(timezone ...string) string
- func (c Carbon) ToRfc1036String(timezone ...string) string
- func (c Carbon) ToRfc1123String(timezone ...string) string
- func (c Carbon) ToRfc1123zString(timezone ...string) string
- func (c Carbon) ToRfc2822String(timezone ...string) string
- func (c Carbon) ToRfc3339MicroString(timezone ...string) string
- func (c Carbon) ToRfc3339MilliString(timezone ...string) string
- func (c Carbon) ToRfc3339NanoString(timezone ...string) string
- func (c Carbon) ToRfc3339String(timezone ...string) string
- func (c Carbon) ToRfc7231String(timezone ...string) string
- func (c Carbon) ToRfc822String(timezone ...string) string
- func (c Carbon) ToRfc822zString(timezone ...string) string
- func (c Carbon) ToRfc850String(timezone ...string) string
- func (c Carbon) ToRssString(timezone ...string) string
- func (c Carbon) ToRubyDateString(timezone ...string) string
- func (c Carbon) ToShortDateMicroString(timezone ...string) string
- func (c Carbon) ToShortDateMilliString(timezone ...string) string
- func (c Carbon) ToShortDateNanoString(timezone ...string) string
- func (c Carbon) ToShortDateString(timezone ...string) string
- func (c Carbon) ToShortDateTimeMicroString(timezone ...string) string
- func (c Carbon) ToShortDateTimeMilliString(timezone ...string) string
- func (c Carbon) ToShortDateTimeNanoString(timezone ...string) string
- func (c Carbon) ToShortDateTimeString(timezone ...string) string
- func (c Carbon) ToShortMonthString(timezone ...string) string
- func (c Carbon) ToShortTimeMicroString(timezone ...string) string
- func (c Carbon) ToShortTimeMilliString(timezone ...string) string
- func (c Carbon) ToShortTimeNanoString(timezone ...string) string
- func (c Carbon) ToShortTimeString(timezone ...string) string
- func (c Carbon) ToShortWeekString(timezone ...string) string
- func (c Carbon) ToString(timezone ...string) string
- func (c Carbon) ToTimeMicroString(timezone ...string) string
- func (c Carbon) ToTimeMilliString(timezone ...string) string
- func (c Carbon) ToTimeNanoString(timezone ...string) string
- func (c Carbon) ToTimeString(timezone ...string) string
- func (c Carbon) ToUnixDateString(timezone ...string) string
- func (c Carbon) ToW3cString(timezone ...string) string
- func (c Carbon) ToWeekString(timezone ...string) string
- func (c Carbon) Tomorrow(timezone ...string) Carbon
- func (c *Carbon) UnSetTestNow()
- func (c *Carbon) UnmarshalJSON(b []byte) error
- func (c Carbon) Value() (driver.Value, error)
- func (c Carbon) Week() int
- func (c Carbon) WeekOfMonth() int
- func (c Carbon) WeekOfYear() int
- func (c Carbon) Year() int
- func (c Carbon) Yesterday(timezone ...string) Carbon
- type Date
- type DateMicro
- type DateMilli
- type DateNano
- type DateTime
- type DateTimeMicro
- type DateTimeMilli
- type DateTimeNano
- type Default
- type Language
- type Time
- type TimeMicro
- type TimeMilli
- type TimeNano
- type Timestamp
- type TimestampMicro
- type TimestampMilli
- type TimestampNano
Constants ¶
const ( Local = "Local" // 本地时间 UTC = "UTC" // 世界协调时间 GMT = "GMT" // 格林尼治标准时间 CST = "CST" // 中国标准时间 EET = "EET" // 欧洲东部标准时间 WET = "WET" // 欧洲西部标准时间 CET = "CET" // 欧洲中部标准时间 EST = "EST" // 美国东部标准时间 MST = "MST" // 美国山地标准时间 Cuba = "Cuba" // 古巴 Egypt = "Egypt" // 埃及 Eire = "Eire" // 爱尔兰 Greenwich = "Greenwich" // 格林尼治 Iceland = "Iceland" // 冰岛 Iran = "Iran" // 伊朗 Israel = "Israel" // 以色列 Jamaica = "Jamaica" // 牙买加 Japan = "Japan" // 日本 Libya = "Libya" // 利比亚 Poland = "Poland" // 波兰 Portugal = "Portugal" // 葡萄牙 PRC = "PRC" // 中国 Singapore = "Singapore" // 新加坡 Turkey = "Turkey" // 土耳其 Shanghai = "Asia/Shanghai" // 上海 Chongqing = "Asia/Chongqing" // 重庆 Harbin = "Asia/Harbin" // 哈尔滨 Urumqi = "Asia/Urumqi" // 乌鲁木齐 HongKong = "Asia/Hong_Kong" // 香港 Macao = "Asia/Macao" // 澳门 Taipei = "Asia/Taipei" // 台北 Tokyo = "Asia/Tokyo" // 东京 HoChiMinh = "Asia/Ho_Chi_Minh" // 胡志明 Hanoi = "Asia/Hanoi" // 河内 Saigon = "Asia/Saigon" // 西贡 Seoul = "Asia/Seoul" // 首尔 Pyongyang = "Asia/Pyongyang" // 平壤 Bangkok = "Asia/Bangkok" // 曼谷 Dubai = "Asia/Dubai" // 迪拜 Qatar = "Asia/Qatar" // 卡塔尔 Bangalore = "Asia/Bangalore" // 班加罗尔 Kolkata = "Asia/Kolkata" // 加尔各答 Mumbai = "Asia/Mumbai" // 孟买 MexicoCity = "America/Mexico_City" // 墨西哥 NewYork = "America/New_York" // 纽约 LosAngeles = "America/Los_Angeles" // 洛杉矶 Chicago = "America/Chicago" // 芝加哥 SaoPaulo = "America/Sao_Paulo" // 圣保罗 Moscow = "Europe/Moscow" // 莫斯科 London = "Europe/London" // 伦敦 Berlin = "Europe/Berlin" // 柏林 Paris = "Europe/Paris" // 巴黎 Rome = "Europe/Rome" // 罗马 Sydney = "Australia/Sydney" // 悉尼 Melbourne = "Australia/Melbourne" // 墨尔本 Darwin = "Australia/Darwin" // 达尔文 )
timezone constants 时区常量
const ( January = "January" // 一月 February = "February" // 二月 March = "March" // 三月 April = "April" // 四月 May = "May" // 五月 June = "June" // 六月 July = "July" // 七月 August = "August" // 八月 September = "September" // 九月 October = "October" // 十月 November = "November" // 十一月 December = "December" // 十二月 )
month constants 月份常量
const ( Monday = "Monday" // 周一 Tuesday = "Tuesday" // 周二 Wednesday = "Wednesday" // 周三 Thursday = "Thursday" // 周四 Friday = "Friday" // 周五 Saturday = "Saturday" // 周六 Sunday = "Sunday" // 周日 )
week constants 星期常量
const ( YearsPerMillennium = 1000 // 每千年1000年 YearsPerCentury = 100 // 每世纪100年 YearsPerDecade = 10 // 每十年10年 QuartersPerYear = 4 // 每年4个季度 MonthsPerYear = 12 // 每年12月 MonthsPerQuarter = 3 // 每季度3月 WeeksPerNormalYear = 52 // 每常规年52周 WeeksPerMonth = 4 // 每月4周 DaysPerLeapYear = 366 // 每闰年366天 DaysPerNormalYear = 365 // 每常规年365天 DaysPerWeek = 7 // 每周7天 HoursPerWeek = 168 // 每周168小时 HoursPerDay = 24 // 每天24小时 MinutesPerDay = 1440 // 每天1440分钟 MinutesPerHour = 60 // 每小时60分钟 SecondsPerWeek = 604800 // 每周604800秒 SecondsPerDay = 86400 // 每天86400秒 SecondsPerHour = 3600 // 每小时3600秒 SecondsPerMinute = 60 // 每分钟60秒 )
number constants 数字常量
const ( AtomLayout = RFC3339Layout ANSICLayout = time.ANSIC CookieLayout = "Monday, 02-Jan-2006 15:04:05 MST" KitchenLayout = time.Kitchen RssLayout = time.RFC1123Z RubyDateLayout = time.RubyDate UnixDateLayout = time.UnixDate W3cLayout = RFC3339Layout RFC1036Layout = "Mon, 02 Jan 06 15:04:05 -0700" RFC1123Layout = time.RFC1123 RFC1123ZLayout = time.RFC1123Z RFC2822Layout = time.RFC1123Z RFC3339Layout = "2006-01-02T15:04:05Z07:00" RFC3339MilliLayout = "2006-01-02T15:04:05.999Z07:00" RFC3339MicroLayout = "2006-01-02T15:04:05.999999Z07:00" RFC3339NanoLayout = "2006-01-02T15:04:05.999999999Z07:00" RFC7231Layout = "Mon, 02 Jan 2006 15:04:05 MST" RFC822Layout = time.RFC822 RFC822ZLayout = time.RFC822Z RFC850Layout = time.RFC850 ISO8601Layout = "2006-01-02T15:04:05-07:00" ISO8601MilliLayout = "2006-01-02T15:04:05.999-07:00" ISO8601MicroLayout = "2006-01-02T15:04:05.999999-07:00" ISO8601NanoLayout = "2006-01-02T15:04:05.999999999-07:00" ISO8601ZuluLayout = "2006-01-02T15:04:05Z" ISO8601ZuluMilliLayout = "2006-01-02T15:04:05.999Z" ISO8601ZuluMicroLayout = "2006-01-02T15:04:05.999999Z" ISO8601ZuluNanoLayout = "2006-01-02T15:04:05.999999999Z" FormattedDateLayout = "Jan 2, 2006" FormattedDayDateLayout = "Mon, Jan 2, 2006" DayDateTimeLayout = "Mon, Jan 2, 2006 3:04 PM" DateTimeLayout = "2006-01-02 15:04:05" DateTimeMilliLayout = "2006-01-02 15:04:05.999" DateTimeMicroLayout = "2006-01-02 15:04:05.999999" DateTimeNanoLayout = "2006-01-02 15:04:05.999999999" ShortDateTimeLayout = "20060102150405" ShortDateTimeMilliLayout = "20060102150405.999" ShortDateTimeMicroLayout = "20060102150405.999999" ShortDateTimeNanoLayout = "20060102150405.999999999" DateLayout = "2006-01-02" DateMilliLayout = "2006-01-02.999" DateMicroLayout = "2006-01-02.999999" DateNanoLayout = "2006-01-02.999999999" ShortDateLayout = "20060102" ShortDateMilliLayout = "20060102.999" ShortDateMicroLayout = "20060102.999999" ShortDateNanoLayout = "20060102.999999999" TimeLayout = "15:04:05" TimeMilliLayout = "15:04:05.999" TimeMicroLayout = "15:04:05.999999" TimeNanoLayout = "15:04:05.999999999" ShortTimeLayout = "150405" ShortTimeMilliLayout = "150405.999" ShortTimeMicroLayout = "150405.999999" ShortTimeNanoLayout = "150405.999999999" )
layout constants 布局模板常量
const ( AtomFormat = "Y-m-d\\TH:i:sP" ANSICFormat = "D M j H:i:s Y" CookieFormat = "l, d-M-Y H:i:s T" KitchenFormat = "g:iA" RssFormat = "D, d M Y H:i:s O" RubyDateFormat = "D M d H:i:s O Y" UnixDateFormat = "D M j H:i:s T Y" RFC1036Format = "D, d M y H:i:s O" RFC1123Format = "D, d M Y H:i:s T" RFC1123ZFormat = "D, d M Y H:i:s O" RFC2822Format = "D, d M Y H:i:s O" RFC3339Format = "Y-m-d\\TH:i:sP" RFC3339MilliFormat = "Y-m-d\\TH:i:s.vP" RFC3339MicroFormat = "Y-m-d\\TH:i:s.uP" RFC3339NanoFormat = "Y-m-d\\TH:i:s.xP" RFC7231Format = "D, d M Y H:i:s T" RFC822Format = "d M y H:i T" RFC822ZFormat = "d M y H:i O" RFC850Format = "l, d-M-y H:i:s T" ISO8601Format = "Y-m-d\\TH:i:sP" ISO8601MilliFormat = "Y-m-d\\TH:i:s.vP" ISO8601MicroFormat = "Y-m-d\\TH:i:s.uP" ISO8601NanoFormat = "Y-m-d\\TH:i:s.xP" ISO8601ZuluFormat = "Y-m-d\\TH:i:s\\Z" ISO8601ZuluMilliFormat = "Y-m-d\\TH:i:s.v\\Z" ISO8601ZuluMicroFormat = "Y-m-d\\TH:i:s.u\\Z" ISO8601ZuluNanoFormat = "Y-m-d\\TH:i:s.x\\Z" FormattedDateFormat = "M j, Y" FormattedDayDateFormat = "D, M j, Y" DayDateTimeFormat = "D, M j, Y g:i A" DateTimeFormat = "Y-m-d H:i:s" DateTimeMilliFormat = "Y-m-d H:i:s.v" DateTimeMicroFormat = "Y-m-d H:i:s.u" DateTimeNanoFormat = "Y-m-d H:i:s.x" ShortDateTimeFormat = "YmdHis" ShortDateTimeMilliFormat = "YmdHis.v" ShortDateTimeMicroFormat = "YmdHis.u" ShortDateTimeNanoFormat = "YmdHis.x" DateFormat = "Y-m-d" DateMilliFormat = "Y-m-d.v" DateMicroFormat = "Y-m-d.u" DateNanoFormat = "Y-m-d.x" ShortDateFormat = "Ymd" ShortDateMilliFormat = "Ymd.v" ShortDateMicroFormat = "Ymd.u" ShortDateNanoFormat = "Ymd.x" TimeFormat = "H:i:s" TimeMilliFormat = "H:i:s.v" TimeMicroFormat = "H:i:s.u" TimeNanoFormat = "H:i:s.x" ShortTimeFormat = "His" ShortTimeMilliFormat = "His.v" ShortTimeMicroFormat = "His.u" ShortTimeNanoFormat = "His.x" )
format constants 格式模板常量
const Version = "2.5.2"
Version current version 当前版本号
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Carbon ¶
type Carbon struct { Error error // contains filtered or unexported fields }
Carbon defines a Carbon struct. 定义 Carbon 结构体
func CreateFromDate ¶
CreateFromDate creates a Carbon instance from a given date. 从给定的年、月、日创建 Carbon 实例
func CreateFromDateMicro ¶
CreateFromDateMicro creates a Carbon instance from a given date and microsecond. 从给定的年、月、日、微秒创建 Carbon 实例
func CreateFromDateMilli ¶
CreateFromDateMilli creates a Carbon instance from a given date and millisecond. 从给定的年、月、日、毫秒创建 Carbon 实例
func CreateFromDateNano ¶
CreateFromDateNano creates a Carbon instance from a given date and nanosecond. 从给定的年、月、日、纳秒创建 Carbon 实例
func CreateFromDateTime ¶
CreateFromDateTime creates a Carbon instance from a given date and time. 从给定的年、月、日、时、分、秒创建 Carbon 实例
func CreateFromDateTimeMicro ¶
func CreateFromDateTimeMicro(year, month, day, hour, minute, second, microsecond int, timezone ...string) Carbon
CreateFromDateTimeMicro creates a Carbon instance from a given date, time and microsecond. 从给定的年、月、日、时、分、秒、微秒创建 Carbon 实例
func CreateFromDateTimeMilli ¶
func CreateFromDateTimeMilli(year, month, day, hour, minute, second, millisecond int, timezone ...string) Carbon
CreateFromDateTimeMilli creates a Carbon instance from a given date, time and millisecond. 从给定的年、月、日、时、分、秒、毫秒创建 Carbon 实例
func CreateFromDateTimeNano ¶
func CreateFromDateTimeNano(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Carbon
CreateFromDateTimeNano creates a Carbon instance from a given date, time and nanosecond. 从给定的年、月、日、时、分、秒、纳秒创建 Carbon 实例
func CreateFromJulian ¶
CreateFromJulian creates a Carbon instance from Julian Day or Modified Julian Day. 从 儒略日/简化儒略日 创建 Carbon 实例
func CreateFromLunar ¶
CreateFromLunar creates a Carbon instance from Lunar date and time. 从 农历日期 创建 Carbon 实例
func CreateFromPersian ¶
CreateFromPersian creates a Carbon instance from Persian date and time. 从 波斯日期 创建 Carbon 实例
func CreateFromStdTime ¶
CreateFromStdTime creates a Carbon instance from standard time.Time. 从标准的 time.Time 创建 Carbon 实例
func CreateFromTime ¶
CreateFromTime creates a Carbon instance from a given time(year, month and day are taken from the current time). 从给定的时、分、秒创建 Carbon 实例(年、月、日取自当前时间)
func CreateFromTimeMicro ¶
CreateFromTimeMicro creates a Carbon instance from a given time and microsecond(year, month and day are taken from the current time). 从给定的时、分、秒、微秒创建 Carbon 实例(年、月、日取自当前时间)
func CreateFromTimeMilli ¶
CreateFromTimeMilli creates a Carbon instance from a given time and millisecond(year, month and day are taken from the current time). 从给定的时、分、秒、毫秒创建 Carbon 实例(年、月、日取自当前时间)
func CreateFromTimeNano ¶
CreateFromTimeNano creates a Carbon instance from a given time and nanosecond(year, month and day are taken from the current time). 从给定的时、分、秒、纳秒创建 Carbon 实例(年、月、日取自当前时间)
func CreateFromTimestamp ¶
CreateFromTimestamp creates a Carbon instance from a given timestamp with second. 从给定的秒级时间戳创建 Carbon 实例
func CreateFromTimestampMicro ¶
CreateFromTimestampMicro creates a Carbon instance from a given timestamp with microsecond. 从给定的微秒级时间戳创建 Carbon 实例
func CreateFromTimestampMilli ¶
CreateFromTimestampMilli creates a Carbon instance from a given timestamp with millisecond. 从给定的毫秒级时间戳创建 Carbon 实例
func CreateFromTimestampNano ¶
CreateFromTimestampNano creates a Carbon instance from a given timestamp with nanosecond. 从给定的纳秒级时间戳创建 Carbon 实例
func Max ¶
Max returns the maximum Carbon instance from the given Carbon instance (second-precision). 返回最大的 Carbon 实例
func MaxValue ¶ added in v2.5.1
func MaxValue() Carbon
MaxValue returns a Carbon instance for the greatest supported date. 返回 Carbon 的最大值
func Min ¶
Min returns the minimum Carbon instance from the given Carbon instance (second-precision). 返回最小的 Carbon 实例
func MinValue ¶ added in v2.5.1
func MinValue() Carbon
MinValue returns a Carbon instance for the lowest supported date. 返回 Carbon 的最小值
func ParseByFormat ¶
ParseByFormat parses a time string as a Carbon instance by format. 通过格式模板将时间字符串解析成 Carbon 实例
func ParseByLayout ¶
ParseByLayout parses a time string as a Carbon instance by layout. 通过布局模板将时间字符串解析成 Carbon 实例
func SetWeekStartsAt ¶
SetWeekStartsAt sets start day of the week. 设置一周的开始日期
func (Carbon) AddCenturies ¶
AddCenturies adds some centuries. N个世纪后
func (Carbon) AddCenturiesNoOverflow ¶
AddCenturiesNoOverflow adds some centuries without overflowing month. N个世纪后(月份不溢出)
func (Carbon) AddCenturyNoOverflow ¶
AddCenturyNoOverflow adds one century without overflowing month. 1个世纪后(月份不溢出)
func (Carbon) AddDecadeNoOverflow ¶
AddDecadeNoOverflow adds one decade without overflowing month. 1个年代后(月份不溢出)
func (Carbon) AddDecades ¶
AddDecades adds some decades. N个年代后
func (Carbon) AddDecadesNoOverflow ¶
AddDecadesNoOverflow adds some decades without overflowing month. N个年代后(月份不溢出)
func (Carbon) AddDuration ¶
AddDuration adds one duration. 按照时长增加时间,支持整数/浮点数和符号ns(纳秒)、us(微妙)、ms(毫秒)、s(秒)、m(分钟)、h(小时)的组合
func (Carbon) AddMicrosecond ¶
AddMicrosecond adds one microsecond. 1微秒后
func (Carbon) AddMicroseconds ¶
AddMicroseconds adds some microseconds. N微秒后
func (Carbon) AddMillisecond ¶
AddMillisecond adds one millisecond. 1毫秒后
func (Carbon) AddMilliseconds ¶
AddMilliseconds adds some milliseconds. N毫秒后
func (Carbon) AddMinutes ¶
AddMinutes adds some minutes. N分钟后
func (Carbon) AddMonthNoOverflow ¶
AddMonthNoOverflow adds one month without overflowing month. 1个月后(月份不溢出)
func (Carbon) AddMonthsNoOverflow ¶
AddMonthsNoOverflow adds some months without overflowing month. N个月后(月份不溢出)
func (Carbon) AddNanosecond ¶
AddNanosecond adds one nanosecond. 1纳秒后
func (Carbon) AddNanoseconds ¶
AddNanoseconds adds some nanoseconds. N纳秒后
func (Carbon) AddQuarterNoOverflow ¶
AddQuarterNoOverflow adds one quarter without overflowing month. 1个季度后(月份不溢出)
func (Carbon) AddQuarters ¶
AddQuarters adds some quarters N个季度后
func (Carbon) AddQuartersNoOverflow ¶
AddQuartersNoOverflow adds quarters without overflowing month. N个季度后(月份不溢出)
func (Carbon) AddSeconds ¶
AddSeconds adds some seconds. N秒钟后
func (Carbon) AddYearNoOverflow ¶
AddYearNoOverflow adds one year without overflowing month. 1年后(月份不溢出)
func (Carbon) AddYearsNoOverflow ¶
AddYearsNoOverflow adds some years without overflowing month. N年后(月份不溢出)
func (Carbon) Between ¶
Between reports whether between two times, excluded the start and end time. 是否在两个时间之间(不包括这两个时间)
func (Carbon) BetweenIncludedBoth ¶
BetweenIncludedBoth reports whether between two times, included the start and end time. 是否在两个时间之间(包括这两个时间)
func (Carbon) BetweenIncludedEnd ¶
BetweenIncludedEnd reports whether between two times, included the end time. 是否在两个时间之间(包括结束时间)
func (Carbon) BetweenIncludedStart ¶
BetweenIncludedStart reports whether between two times, included the start time. 是否在两个时间之间(包括开始时间)
func (Carbon) Closest ¶
Closest returns the closest Carbon instance from the given Carbon instance. 返回离给定 carbon 实例最近的 Carbon 实例
func (Carbon) Constellation ¶
Constellation gets constellation name like "Aries", i18n is supported. 获取星座,支持i18n
func (Carbon) CreateFromDate ¶
CreateFromDate creates a Carbon instance from a given date. 从给定的年、月、日创建 Carbon 实例
func (Carbon) CreateFromDateMicro ¶
CreateFromDateMicro creates a Carbon instance from a given date and microsecond. 从给定的年、月、日、微秒创建 Carbon 实例
func (Carbon) CreateFromDateMilli ¶
CreateFromDateMilli creates a Carbon instance from a given date and millisecond. 从给定的年、月、日、毫秒创建 Carbon 实例
func (Carbon) CreateFromDateNano ¶
CreateFromDateNano creates a Carbon instance from a given date and nanosecond. 从给定的年、月、日、纳秒创建 Carbon 实例
func (Carbon) CreateFromDateTime ¶
func (c Carbon) CreateFromDateTime(year, month, day, hour, minute, second int, timezone ...string) Carbon
CreateFromDateTime creates a Carbon instance from a given date and time. 从给定的年、月、日、时、分、秒创建 Carbon 实例
func (Carbon) CreateFromDateTimeMicro ¶
func (c Carbon) CreateFromDateTimeMicro(year, month, day, hour, minute, second, microsecond int, timezone ...string) Carbon
CreateFromDateTimeMicro creates a Carbon instance from a given date, time and microsecond. 从给定的年、月、日、时、分、秒、微秒创建 Carbon 实例
func (Carbon) CreateFromDateTimeMilli ¶
func (c Carbon) CreateFromDateTimeMilli(year, month, day, hour, minute, second, millisecond int, timezone ...string) Carbon
CreateFromDateTimeMilli creates a Carbon instance from a given date, time and millisecond. 从给定的年、月、日、时、分、秒、毫秒创建 Carbon 实例
func (Carbon) CreateFromDateTimeNano ¶
func (c Carbon) CreateFromDateTimeNano(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Carbon
CreateFromDateTimeNano creates a Carbon instance from a given date, time and nanosecond. 从给定的年、月、日、时、分、秒、纳秒创建 Carbon 实例
func (Carbon) CreateFromTime ¶
CreateFromTime creates a Carbon instance from a given time(year, month and day are taken from the current time). 从给定的时、分、秒创建 Carbon 实例(年、月、日取自当前时间)
func (Carbon) CreateFromTimeMicro ¶
func (c Carbon) CreateFromTimeMicro(hour, minute, second, microsecond int, timezone ...string) Carbon
CreateFromTimeMicro creates a Carbon instance from a given time and microsecond(year, month and day are taken from the current time). 从给定的时、分、秒、微秒创建 Carbon 实例(年、月、日取自当前时间)
func (Carbon) CreateFromTimeMilli ¶
func (c Carbon) CreateFromTimeMilli(hour, minute, second, millisecond int, timezone ...string) Carbon
CreateFromTimeMilli creates a Carbon instance from a given time and millisecond(year, month and day are taken from the current time). 从给定的时、分、秒、毫秒创建 Carbon 实例(年、月、日取自当前时间)
func (Carbon) CreateFromTimeNano ¶
CreateFromTimeNano creates a Carbon instance from a given time and nanosecond(year, month and day are taken from the current time). 从给定的时、分、秒、纳秒创建 Carbon 实例(年、月、日取自当前时间)
func (Carbon) CreateFromTimestamp ¶
CreateFromTimestamp creates a Carbon instance from a given timestamp with second. 从给定的秒级时间戳创建 Carbon 实例
func (Carbon) CreateFromTimestampMicro ¶
CreateFromTimestampMicro creates a Carbon instance from a given timestamp with microsecond. 从给定的微秒级时间戳创建 Carbon 实例
func (Carbon) CreateFromTimestampMilli ¶
CreateFromTimestampMilli creates a Carbon instance from a given timestamp with millisecond. 从给定的毫秒级时间戳创建 Carbon 实例
func (Carbon) CreateFromTimestampNano ¶
CreateFromTimestampNano creates a Carbon instance from a given timestamp with nanosecond. 从给定的纳秒级时间戳创建 Carbon 实例
func (Carbon) DateMicro ¶
DateMicro gets current year, month, day and microsecond like 2020, 8, 5, 999999. 获取当前年、月、日、微秒
func (Carbon) DateMilli ¶
DateMilli gets current year, month, day and millisecond like 2020, 8, 5, 999. 获取当前年、月、日、毫秒
func (Carbon) DateNano ¶
DateNano gets current year, month, day and nanosecond like 2020, 8, 5, 999999999. 获取当前年、月、日、纳秒
func (Carbon) DateTime ¶
DateTime gets current year, month, day, hour, minute, and second like 2020, 8, 5, 13, 14, 15. 获取当前年、月、日、时、分、秒
func (Carbon) DateTimeMicro ¶
DateTimeMicro gets current year, month, day, hour, minute, second and microsecond like 2020, 8, 5, 13, 14, 15, 999999. 获取当前年、月、日、时、分、秒、微秒
func (Carbon) DateTimeMilli ¶
DateTimeMilli gets current year, month, day, hour, minute, second and millisecond like 2020, 8, 5, 13, 14, 15, 999. 获取当前年、月、日、时、分、秒、毫秒
func (Carbon) DateTimeNano ¶
DateTimeNano gets current year, month, day, hour, minute, second and nanosecond like 2020, 8, 5, 13, 14, 15, 999999999. 获取当前年、月、日、时、分、秒、纳秒
func (Carbon) DayOfMonth ¶
DayOfMonth gets day of month like 30. 获取本月的第几天
func (Carbon) DaysInMonth ¶
DaysInMonth gets total days in month like 30. 获取本月的总天数
func (Carbon) DaysInYear ¶
DaysInYear gets total days in year like 365. 获取本年的总天数
func (Carbon) DiffAbsInDays ¶
DiffAbsInDays gets the difference in days with absolute value. 相差多少天(绝对值)
func (Carbon) DiffAbsInDuration ¶
DiffAbsInDuration gets the difference in duration with absolute value. 相差时长(绝对值)
func (Carbon) DiffAbsInHours ¶
DiffAbsInHours gets the difference in hours with absolute value. 相差多少小时(绝对值)
func (Carbon) DiffAbsInMinutes ¶
DiffAbsInMinutes gets the difference in minutes with absolute value. 相差多少分钟(绝对值)
func (Carbon) DiffAbsInMonths ¶
DiffAbsInMonths gets the difference in months with absolute value. 相差多少月(绝对值)
func (Carbon) DiffAbsInSeconds ¶
DiffAbsInSeconds gets the difference in seconds with absolute value. 相差多少秒(绝对值)
func (Carbon) DiffAbsInString ¶
DiffAbsInString gets the difference in string with absolute value, i18n is supported. 相差字符串,支持i18n(绝对值)
func (Carbon) DiffAbsInWeeks ¶
DiffAbsInWeeks gets the difference in weeks with absolute value. 相差多少周(绝对值)
func (Carbon) DiffAbsInYears ¶
DiffAbsInYears gets the difference in years with absolute value. 相差多少年(绝对值)
func (Carbon) DiffForHumans ¶
DiffForHumans gets the difference in a human-readable format, i18n is supported. 获取对人类友好的可读格式时间差,支持i18n
func (Carbon) DiffInDays ¶
DiffInDays gets the difference in days. 相差多少天
func (Carbon) DiffInDuration ¶
DiffInDuration gets the difference in duration. 相差时长
func (Carbon) DiffInHours ¶
DiffInHours gets the difference in hours. 相差多少小时
func (Carbon) DiffInMinutes ¶
DiffInMinutes gets the difference in minutes. 相差多少分钟
func (Carbon) DiffInMonths ¶
DiffInMonths gets the difference in months. 相差多少月
func (Carbon) DiffInSeconds ¶
DiffInSeconds gets the difference in seconds. 相差多少秒
func (Carbon) DiffInString ¶
DiffInString gets the difference in string, i18n is supported. 相差字符串,支持i18n
func (Carbon) DiffInWeeks ¶
DiffInWeeks gets the difference in weeks. 相差多少周
func (Carbon) DiffInYears ¶
DiffInYears gets the difference in years. 相差多少年
func (Carbon) EndOfCentury ¶
EndOfCentury returns a Carbon instance for end of the century. 本世纪结束时间
func (Carbon) EndOfDecade ¶
EndOfDecade returns a Carbon instance for end of the decade. 本年代结束时间
func (Carbon) EndOfMinute ¶
EndOfMinute returns a Carbon instance for end of the minute. 分钟结束时间
func (Carbon) EndOfMonth ¶
EndOfMonth returns a Carbon instance for end of the month. 本月结束时间
func (Carbon) EndOfQuarter ¶
EndOfQuarter returns a Carbon instance for end of the quarter. 本季度结束时间
func (Carbon) EndOfSeason ¶
EndOfSeason returns a Carbon instance for end of the season. 本季节结束时间
func (Carbon) EndOfSecond ¶
EndOfSecond returns a Carbon instance for end of the second. 秒结束时间
func (Carbon) Farthest ¶
Farthest returns the farthest Carbon instance from the given Carbon instance. 返回离给定 carbon 实例最远的 Carbon 实例
func (Carbon) GoString ¶
GoString implements fmt.GoStringer and formats c to be printed in Go source code. 实现 fmt.GoStringer 接口,并格式化 c 以在 Go 源代码中打印
func (Carbon) IsAquarius ¶
IsAquarius reports whether is Aquarius. 是否是水瓶座
func (Carbon) IsCapricorn ¶
IsCapricorn reports whether is Capricorn. 是否是摩羯座
func (Carbon) IsDecember ¶
IsDecember reports whether is December. 是否是十二月
func (Carbon) IsFebruary ¶
IsFebruary reports whether is February. 是否是二月
func (Carbon) IsLeapYear ¶
IsLeapYear reports whether is a leap year. 是否是闰年
func (Carbon) IsLongYear ¶
IsLongYear reports whether is a long year, see https://en.wikipedia.org/wiki/ISO_8601#Week_dates. 是否是长年
func (Carbon) IsNovember ¶
IsNovember reports whether is November. 是否是十一月
func (Carbon) IsSagittarius ¶
IsSagittarius reports whether is Sagittarius. 是否是射手座
func (Carbon) IsSameCentury ¶
IsSameCentury reports whether is same century. 是否是同一世纪
func (Carbon) IsSameDecade ¶
IsSameDecade reports whether is same decade. 是否是同一年代
func (Carbon) IsSameHour ¶
IsSameHour reports whether is same hour. 是否是同一小时
func (Carbon) IsSameMinute ¶
IsSameMinute reports whether is same minute. 是否是同一分钟
func (Carbon) IsSameMonth ¶
IsSameMonth reports whether is same month. 是否是同一月
func (Carbon) IsSameQuarter ¶
IsSameQuarter reports whether is same quarter. 是否是同一季节
func (Carbon) IsSameSecond ¶
IsSameSecond reports whether is same second. 是否是同一秒
func (Carbon) IsSameYear ¶
IsSameYear reports whether is same year. 是否是同一年
func (Carbon) IsSaturday ¶
IsSaturday reports whether is Saturday. 是否是周六
func (Carbon) IsSeptember ¶
IsSeptember reports whether is September. 是否是九月
func (Carbon) IsSetTestNow ¶
IsSetTestNow report whether there is testing time now. 是否设置过当前测试时间
func (Carbon) IsThursday ¶
IsThursday reports whether is Thursday. 是否是周四
func (Carbon) IsTomorrow ¶
IsTomorrow reports whether is tomorrow. 是否是明天
func (Carbon) IsWednesday ¶
IsWednesday reports whether is Wednesday. 是否是周三
func (Carbon) IsYesterday ¶
IsYesterday reports whether is yesterday. 是否是昨天
func (Carbon) IsZero ¶
IsZero reports whether is zero time(0001-01-01 00:00:00 +0000 UTC). 是否是零值时间(0001-01-01 00:00:00 +0000 UTC)
func (Carbon) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for Carbon struct. 实现 json.Marshaler 接口
func (Carbon) Microsecond ¶
Microsecond gets current microsecond like 999999. 获取当前微秒数
func (Carbon) Millisecond ¶
Millisecond gets current millisecond like 999. 获取当前毫秒数
func (Carbon) MonthOfYear ¶
MonthOfYear gets month of year like 12. 获取本年的第几月
func (Carbon) Nanosecond ¶
Nanosecond gets current nanosecond like 999999999. 获取当前纳秒数
func (Carbon) Offset ¶
Offset gets offset seconds from the UTC timezone like 28800. 获取距离UTC时区的偏移量,单位秒
func (Carbon) Parse ¶
Parse parses a standard time string as a Carbon instance. 将标准格式时间字符串解析成 Carbon 实例
func (Carbon) ParseByFormat ¶
ParseByFormat parses a time string as a Carbon instance by format. 通过格式模板将时间字符串解析成 Carbon 实例
func (Carbon) ParseByLayout ¶
ParseByLayout parses a time string as a Carbon instance by layout. 通过布局模板将时间字符串解析成 Carbon 实例
func (Carbon) Persian ¶
Persian converts Carbon instance to Persian instance. 将 Carbon 实例转化为 Persian 实例
func (*Carbon) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (Carbon) Season ¶
Season gets season name according to the meteorological division method like "Spring", i18n is supported. 获取当前季节(以气象划分),支持i18n
func (Carbon) SetDateMicro ¶
SetDateMicro sets year, month, day and microsecond. 设置年、月、日、微秒
func (Carbon) SetDateMilli ¶
SetDateMilli sets year, month, day and millisecond. 设置年、月、日、毫秒
func (Carbon) SetDateNano ¶
SetDateNano sets year, month, day and nanosecond. 设置年、月、日、纳秒
func (Carbon) SetDateTime ¶
SetDateTime sets year, month, day, hour, minute and second. 设置年、月、日、时、分、秒
func (Carbon) SetDateTimeMicro ¶
SetDateTimeMicro sets year, month, day, hour, minute, second and microsecond. 设置年、月、日、时、分、秒、微秒
func (Carbon) SetDateTimeMilli ¶
SetDateTimeMilli sets year, month, day, hour, minute, second and millisecond. 设置年、月、日、时、分、秒、毫秒
func (Carbon) SetDateTimeNano ¶
SetDateTimeNano sets year, month, day, hour, minute, second and nanosecond. 设置年、月、日、时、分、秒、纳秒
func (Carbon) SetLocation ¶
SetLocation sets location. 设置地区
func (Carbon) SetMicrosecond ¶
SetMicrosecond sets microsecond. 设置微秒
func (Carbon) SetMillisecond ¶
SetMillisecond sets millisecond. 设置毫秒
func (Carbon) SetMonthNoOverflow ¶
SetMonthNoOverflow sets month without overflowing month. 设置月份(月份不溢出)
func (Carbon) SetNanosecond ¶
SetNanosecond sets nanosecond. 设置纳秒
func (*Carbon) SetTestNow ¶
SetTestNow sets a test Carbon instance (real or mock) to be returned when a "now" instance is created. 设置当前测试时间
func (Carbon) SetTimeMicro ¶
SetTimeMicro sets hour, minute, second and microsecond. 设置时、分、秒、微秒
func (Carbon) SetTimeMilli ¶
SetTimeMilli sets hour, minute, second and millisecond. 设置时、分、秒、毫秒
func (Carbon) SetTimeNano ¶
SetTimeNano sets hour, minute, second and nanosecond. 设置、时、分、秒、纳秒
func (Carbon) SetTimezone ¶
SetTimezone sets timezone. 设置时区
func (Carbon) SetWeekStartsAt ¶
SetWeekStartsAt sets start day of the week. 设置一周的开始日期
func (Carbon) SetYearNoOverflow ¶
SetYearNoOverflow sets year without overflowing month. 设置年份(月份不溢出)
func (Carbon) StartOfCentury ¶
StartOfCentury returns a Carbon instance for start of the century. 本世纪开始时间
func (Carbon) StartOfDay ¶
StartOfDay returns a Carbon instance for start of the day. 本日开始时间
func (Carbon) StartOfDecade ¶
StartOfDecade returns a Carbon instance for start of the decade. 本年代开始时间
func (Carbon) StartOfHour ¶
StartOfHour returns a Carbon instance for start of the hour. 小时开始时间
func (Carbon) StartOfMinute ¶
StartOfMinute returns a Carbon instance for start of the minute. 分钟开始时间
func (Carbon) StartOfMonth ¶
StartOfMonth returns a Carbon instance for start of the month. 本月开始时间
func (Carbon) StartOfQuarter ¶
StartOfQuarter returns a Carbon instance for start of the quarter. 本季度开始时间
func (Carbon) StartOfSeason ¶
StartOfSeason returns a Carbon instance for start of the season. 本季节开始时间
func (Carbon) StartOfSecond ¶
StartOfSecond returns a Carbon instance for start of the second. 秒开始时间
func (Carbon) StartOfWeek ¶
StartOfWeek returns a Carbon instance for start of the week. 本周开始时间
func (Carbon) StartOfYear ¶
StartOfYear returns a Carbon instance for start of the year. 本年开始时间
func (Carbon) SubCenturies ¶
SubCenturies subtracts some centuries. N个世纪前
func (Carbon) SubCenturiesNoOverflow ¶
SubCenturiesNoOverflow subtracts some centuries without overflowing month. N个世纪前(月份不溢出)
func (Carbon) SubCentury ¶
SubCentury subtracts one century. 1个世纪前
func (Carbon) SubCenturyNoOverflow ¶
SubCenturyNoOverflow subtracts one century without overflowing month. 1个世纪前(月份不溢出)
func (Carbon) SubDecadeNoOverflow ¶
SubDecadeNoOverflow subtracts one decade without overflowing month. 1个年代后(月份不溢出)
func (Carbon) SubDecades ¶
SubDecades subtracts some decades. N个年代后
func (Carbon) SubDecadesNoOverflow ¶
SubDecadesNoOverflow subtracts some decades without overflowing month. N个年代后(月份不溢出)
func (Carbon) SubDuration ¶
SubDuration subtracts one duration. 按照时长减少时间,支持整数/浮点数和符号ns(纳秒)、us(微妙)、ms(毫秒)、s(秒)、m(分钟)、h(小时)的组合
func (Carbon) SubMicrosecond ¶
SubMicrosecond subtracts one microsecond. 1微秒前
func (Carbon) SubMicroseconds ¶
SubMicroseconds subtracts some microseconds. N微秒前
func (Carbon) SubMillisecond ¶
SubMillisecond subtracts one millisecond. 1毫秒前
func (Carbon) SubMilliseconds ¶
SubMilliseconds subtracts some milliseconds. N毫秒前
func (Carbon) SubMinutes ¶
SubMinutes subtracts some minutes. N分钟前
func (Carbon) SubMonthNoOverflow ¶
SubMonthNoOverflow subtracts one month without overflowing month. 1个月前(月份不溢出)
func (Carbon) SubMonthsNoOverflow ¶
SubMonthsNoOverflow subtracts some months without overflowing month. N个月前(月份不溢出)
func (Carbon) SubNanosecond ¶
SubNanosecond subtracts one nanosecond. 1纳秒前
func (Carbon) SubNanoseconds ¶
SubNanoseconds subtracts some nanoseconds. N纳秒前
func (Carbon) SubQuarter ¶
SubQuarter subtracts one quarter. 1个季度前
func (Carbon) SubQuarterNoOverflow ¶
SubQuarterNoOverflow subtracts one quarter without overflowing month. 1个季度前(月份不溢出)
func (Carbon) SubQuarters ¶
SubQuarters subtracts some quarters. N个季度前
func (Carbon) SubQuartersNoOverflow ¶
SubQuartersNoOverflow subtracts some quarters without overflowing month. N个季度前(月份不溢出)
func (Carbon) SubSeconds ¶
SubSeconds subtracts some seconds. N秒钟前
func (Carbon) SubYearNoOverflow ¶
SubYearNoOverflow subtracts one year without overflowing month. 1年前(月份不溢出)
func (Carbon) SubYearsNoOverflow ¶
SubYearsNoOverflow subtracts some years without overflowing month. N年前(月份不溢出)
func (Carbon) TimeMicro ¶
TimeMicro gets current hour, minute, second and microsecond like 13, 14, 15, 999999. 获取当前时、分、秒、微秒
func (Carbon) TimeMilli ¶
TimeMilli gets current hour, minute, second and millisecond like 13, 14, 15, 999. 获取当前时、分、秒、毫秒
func (Carbon) TimeNano ¶
TimeNano gets current hour, minute, second and nanosecond like 13, 14, 15, 999999999. 获取当前时、分、秒、纳秒
func (Carbon) TimestampMicro ¶
TimestampMicro gets timestamp with microsecond like 1596604455000000. 获取微秒级时间戳
func (Carbon) TimestampMilli ¶
TimestampMilli gets timestamp with millisecond like 1596604455000. 获取毫秒级时间戳
func (Carbon) TimestampNano ¶
TimestampNano gets timestamp with nanosecond like 1596604455000000000. 获取纳秒级时间戳
func (Carbon) ToAnsicString ¶
ToAnsicString outputs a string in "Mon Jan _2 15:04:05 2006" layout. 输出 "Mon Jan _2 15:04:05 2006" 格式字符串
func (Carbon) ToAtomString ¶
ToAtomString outputs a string in "2006-01-02T15:04:05Z07:00" layout. 输出 "2006-01-02T15:04:05Z07:00" 格式字符串
func (Carbon) ToCookieString ¶
ToCookieString outputs a string in "Monday, 02-Jan-2006 15:04:05 MST" layout. 输出 "Monday, 02-Jan-2006 15:04:05 MST" 格式字符串
func (Carbon) ToDateMicroString ¶
ToDateMicroString outputs a string in "2006-01-02.999999" layout. 输出 "2006-01-02.999999" 格式字符串
func (Carbon) ToDateMilliString ¶
ToDateMilliString outputs a string in "2006-01-02.999" layout. 输出 "2006-01-02.999" 格式字符串
func (Carbon) ToDateNanoString ¶
ToDateNanoString outputs a string in "2006-01-02.999999999" layout. 输出 "2006-01-02.999999999" 格式字符串
func (Carbon) ToDateString ¶
ToDateString outputs a string in "2006-01-02" layout. 输出 "2006-01-02" 格式字符串
func (Carbon) ToDateTimeMicroString ¶
ToDateTimeMicroString outputs a string in "2006-01-02 15:04:05.999999" layout. 输出 "2006-01-02 15:04:05.999999" 格式字符串
func (Carbon) ToDateTimeMilliString ¶
ToDateTimeMilliString outputs a string in "2006-01-02 15:04:05.999" layout. 输出 "2006-01-02 15:04:05.999" 格式字符串
func (Carbon) ToDateTimeNanoString ¶
ToDateTimeNanoString outputs a string in "2006-01-02 15:04:05.999999999" layout. 输出 "2006-01-02 15:04:05.999999999" 格式字符串
func (Carbon) ToDateTimeString ¶
ToDateTimeString outputs a string in "2006-01-02 15:04:05" layout. 输出 "2006-01-02 15:04:05" 格式字符串
func (Carbon) ToDayDateTimeString ¶
ToDayDateTimeString outputs a string in "Mon, Jan 2, 2006 3:04 PM" layout. 输出 "Mon, Jan 2, 2006 3:04 PM" 格式字符串
func (Carbon) ToFormattedDateString ¶
ToFormattedDateString outputs a string in "Jan 2, 2006" layout. 输出 "Jan 2, 2006" 格式字符串
func (Carbon) ToFormattedDayDateString ¶
ToFormattedDayDateString outputs a string in "Mon, Jan 2, 2006" layout. 输出 "Jan 2, 2006" 格式字符串
func (Carbon) ToIso8601MicroString ¶
ToIso8601MicroString outputs a string in "2006-01-02T15:04:05.999999-07:00" layout. 输出 "2006-01-02T15:04:05.999999-07:00" 格式字符串
func (Carbon) ToIso8601MilliString ¶
ToIso8601MilliString outputs a string in "2006-01-02T15:04:05.999-07:00" layout. 输出 "2006-01-02T15:04:05.999-07:00" 格式字符串
func (Carbon) ToIso8601NanoString ¶
ToIso8601NanoString outputs a string in "2006-01-02T15:04:05.999999999-07:00" layout. 输出 "2006-01-02T15:04:05.999999999-07:00" 格式字符串
func (Carbon) ToIso8601String ¶
ToIso8601String outputs a string in "2006-01-02T15:04:05-07:00" layout. 输出 "2006-01-02T15:04:05-07:00" 格式字符串
func (Carbon) ToIso8601ZuluMicroString ¶
ToIso8601ZuluMicroString outputs a string in "2006-01-02T15:04:05.999999Z" layout. 输出 "2006-01-02T15:04:05.999999Z" 格式字符串
func (Carbon) ToIso8601ZuluMilliString ¶
ToIso8601ZuluMilliString outputs a string in "2006-01-02T15:04:05.999Z" layout. 输出 "2006-01-02T15:04:05.999Z" 格式字符串
func (Carbon) ToIso8601ZuluNanoString ¶
ToIso8601ZuluNanoString outputs a string in "2006-01-02T15:04:05.999999999Z" layout. 输出 "2006-01-02T15:04:05.999999999Z" 格式字符串
func (Carbon) ToIso8601ZuluString ¶
ToIso8601ZuluString outputs a string in "2006-01-02T15:04:05Z" layout. 输出 "2006-01-02T15:04:05Z" 格式字符串
func (Carbon) ToKitchenString ¶
ToKitchenString outputs a string in "3:04PM" layout. 输出 "3:04PM" 格式字符串
func (Carbon) ToMonthString ¶
ToMonthString outputs a string in month layout like "January", i18n is supported. 输出完整月份字符串,支持i18n
func (Carbon) ToRfc1036String ¶
ToRfc1036String outputs a string in "Mon, 02 Jan 06 15:04:05 -0700" layout. 输出 "Mon, 02 Jan 06 15:04:05 -0700" 格式字符串
func (Carbon) ToRfc1123String ¶
ToRfc1123String outputs a string in "Mon, 02 Jan 2006 15:04:05 MST" layout. 输出 "Mon, 02 Jan 2006 15:04:05 MST" 格式字符串
func (Carbon) ToRfc1123zString ¶
ToRfc1123zString outputs a string in "Mon, 02 Jan 2006 15:04:05 -0700" layout. 输出 "Mon, 02 Jan 2006 15:04:05 -0700" 格式字符串
func (Carbon) ToRfc2822String ¶
ToRfc2822String outputs a string in "Mon, 02 Jan 2006 15:04:05 -0700" layout. 输出 "Mon, 02 Jan 2006 15:04:05 -0700" 格式字符串
func (Carbon) ToRfc3339MicroString ¶
ToRfc3339MicroString outputs a string in "2006-01-02T15:04:05.999999Z07:00" layout. 输出 "2006-01-02T15:04:05.999999Z07:00" 格式字符串
func (Carbon) ToRfc3339MilliString ¶
ToRfc3339MilliString outputs a string in "2006-01-02T15:04:05.999Z07:00" layout. 输出 "2006-01-02T15:04:05.999Z07:00" 格式字符串
func (Carbon) ToRfc3339NanoString ¶
ToRfc3339NanoString outputs a string in "2006-01-02T15:04:05.999999999Z07:00" layout. 输出 "2006-01-02T15:04:05.999999999Z07:00" 格式字符串
func (Carbon) ToRfc3339String ¶
ToRfc3339String outputs a string in "2006-01-02T15:04:05Z07:00" layout. 输出 "2006-01-02T15:04:05Z07:00" 格式字符串
func (Carbon) ToRfc7231String ¶
ToRfc7231String outputs a string in "Mon, 02 Jan 2006 15:04:05 GMT" layout. 输出 "Mon, 02 Jan 2006 15:04:05 GMT" 格式字符串
func (Carbon) ToRfc822String ¶
ToRfc822String outputs a string in "02 Jan 06 15:04 MST" layout. 输出 "02 Jan 06 15:04 MST" 格式字符串
func (Carbon) ToRfc822zString ¶
ToRfc822zString outputs a string in "02 Jan 06 15:04 -0700" layout. 输出 "02 Jan 06 15:04 -0700" 格式字符串
func (Carbon) ToRfc850String ¶
ToRfc850String outputs a string in "Monday, 02-Jan-06 15:04:05 MST" layout. 输出 "Monday, 02-Jan-06 15:04:05 MST" 格式字符串
func (Carbon) ToRssString ¶
ToRssString outputs a string in "Mon, 02 Jan 2006 15:04:05 -0700" format. 输出 "Mon, 02 Jan 2006 15:04:05 -0700" 格式字符串
func (Carbon) ToRubyDateString ¶
ToRubyDateString outputs a string in "Mon Jan 02 15:04:05 -0700 2006" layout. 输出 "Mon Jan 02 15:04:05 -0700 2006" 格式字符串
func (Carbon) ToShortDateMicroString ¶
ToShortDateMicroString outputs a string in "20060102.999999" layout. 输出 "20060102.999999" 格式字符串
func (Carbon) ToShortDateMilliString ¶
ToShortDateMilliString outputs a string in "20060102.999" layout. 输出 "20060102.999" 格式字符串
func (Carbon) ToShortDateNanoString ¶
ToShortDateNanoString outputs a string in "20060102.999999999" layout. 输出 "20060102.999999999" 格式字符串
func (Carbon) ToShortDateString ¶
ToShortDateString outputs a string in "20060102" layout. 输出 "20060102" 格式字符串
func (Carbon) ToShortDateTimeMicroString ¶
ToShortDateTimeMicroString outputs a string in "20060102150405.999999" layout. 输出 "20060102150405.999999" 格式字符串
func (Carbon) ToShortDateTimeMilliString ¶
ToShortDateTimeMilliString outputs a string in "20060102150405.999" layout. 输出 "20060102150405.999" 格式字符串
func (Carbon) ToShortDateTimeNanoString ¶
ToShortDateTimeNanoString outputs a string in "20060102150405.999999999" layout. 输出 "20060102150405.999999999" 格式字符串
func (Carbon) ToShortDateTimeString ¶
ToShortDateTimeString outputs a string in "20060102150405" layout. 输出 "20060102150405" 格式字符串
func (Carbon) ToShortMonthString ¶
ToShortMonthString outputs a string in short month layout like "Jan", i18n is supported. 输出缩写月份字符串,支持i18n
func (Carbon) ToShortTimeMicroString ¶
ToShortTimeMicroString outputs a string in "150405.999999" layout. 输出 "150405.999999" 格式字符串
func (Carbon) ToShortTimeMilliString ¶
ToShortTimeMilliString outputs a string in "150405.999" layout. 输出 "150405.999" 格式字符串
func (Carbon) ToShortTimeNanoString ¶
ToShortTimeNanoString outputs a string in "150405.999999999" layout. 输出 "150405.999999999" 格式字符串
func (Carbon) ToShortTimeString ¶
ToShortTimeString outputs a string in "150405" layout. 输出 "150405" 格式字符串
func (Carbon) ToShortWeekString ¶
ToShortWeekString outputs a string in short week layout like "Sun", i18n is supported. 输出缩写星期字符串,支持i18n
func (Carbon) ToString ¶
ToString outputs a string in "2006-01-02 15:04:05.999999999 -0700 MST" layout. 输出 "2006-01-02 15:04:05.999999999 -0700 MST" 格式字符串
func (Carbon) ToTimeMicroString ¶
ToTimeMicroString outputs a string in "15:04:05.999999" layout. 输出 "15:04:05.999999" 格式字符串
func (Carbon) ToTimeMilliString ¶
ToTimeMilliString outputs a string in "15:04:05.999" layout. 输出 "15:04:05.999" 格式字符串
func (Carbon) ToTimeNanoString ¶
ToTimeNanoString outputs a string in "15:04:05.999999999" layout. 输出 "15:04:05.999999999" 格式字符串
func (Carbon) ToTimeString ¶
ToTimeString outputs a string in "15:04:05" layout. 输出 "15:04:05" 格式字符串
func (Carbon) ToUnixDateString ¶
ToUnixDateString outputs a string in "Mon Jan _2 15:04:05 MST 2006" layout. 输出 "Mon Jan _2 15:04:05 MST 2006" 格式字符串
func (Carbon) ToW3cString ¶
ToW3cString outputs a string in "2006-01-02T15:04:05Z07:00" layout. 输出 "2006-01-02T15:04:05Z07:00" 格式字符串
func (Carbon) ToWeekString ¶
ToWeekString outputs a string in week layout like "Sunday", i18n is supported. 输出完整星期字符串,支持i18n
func (*Carbon) UnSetTestNow ¶
func (c *Carbon) UnSetTestNow()
UnSetTestNow clears a test Carbon instance (real or mock) to be returned when a "now" instance is created. 清除当前测试时间
func (*Carbon) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for Carbon struct. 实现 json.Unmarshaler 接口
func (Carbon) Value ¶
Value the interface providing the Value method for package database/sql/driver.
func (Carbon) WeekOfMonth ¶
WeekOfMonth gets week of month like 1. 获取本月的第几周
func (Carbon) WeekOfYear ¶
WeekOfYear gets week of year like 1, see https://en.wikipedia.org/wiki/ISO_8601#Week_dates. 获取本年的第几周
type Date ¶
type Date struct {
Carbon
}
Date defines a Date struct. 定义 Date 结构体
func (Date) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for Date struct. 实现 MarshalJSON 接口
func (*Date) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for Date struct. 实现 UnmarshalJSON 接口
type DateMicro ¶
type DateMicro struct {
Carbon
}
DateMicro defines a DateMicro struct. 定义 DateMicro 结构体
func NewDateMicro ¶
NewDateMicro returns a new DateMicro instance. 初始化 DateMicro 结构体
func (DateMicro) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for DateMicro struct. 实现 MarshalJSON 接口
func (*DateMicro) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (DateMicro) String ¶
String implements the interface Stringer for DateMicro struct. 实现 Stringer 接口
func (*DateMicro) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for DateMicro struct. 实现 UnmarshalJSON 接口
type DateMilli ¶
type DateMilli struct {
Carbon
}
DateMilli defines a DateMilli struct. 定义 DateMilli 结构体
func NewDateMilli ¶
NewDateMilli returns a new DateMilli instance. 初始化 DateMilli 结构体
func (DateMilli) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for DateMilli struct. 实现 MarshalJSON 接口
func (*DateMilli) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (DateMilli) String ¶
String implements the interface Stringer for DateMilli struct. 实现 Stringer 接口
func (*DateMilli) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for DateMilli struct. 实现 UnmarshalJSON 接口
type DateNano ¶
type DateNano struct {
Carbon
}
DateNano defines a DateNano struct. 定义 DateNano 结构体
func NewDateNano ¶
NewDateNano returns a new DateNano instance. 初始化 DateNano 结构体
func (DateNano) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for DateNano struct. 实现 MarshalJSON 接口
func (*DateNano) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (DateNano) String ¶
String implements the interface Stringer for DateNano struct. 实现 Stringer 接口
func (*DateNano) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for DateNano struct. 实现 UnmarshalJSON 接口
type DateTime ¶
type DateTime struct {
Carbon
}
DateTime defines a DateTime struct. 定义 DateTime 结构体
func NewDateTime ¶
NewDateTime returns a new DateTime instance. 初始化 DateTime 结构体
func (DateTime) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for DateTime struct. 实现 MarshalJSON 接口
func (*DateTime) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (DateTime) String ¶
String implements the interface Stringer for DateTime struct. 实现 Stringer 接口
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for DateTime struct. 实现 UnmarshalJSON 接口
type DateTimeMicro ¶
type DateTimeMicro struct {
Carbon
}
DateTimeMicro defines a DateTimeMicro struct. 定义 DateTimeMicro 结构体
func NewDateTimeMicro ¶
func NewDateTimeMicro(carbon Carbon) DateTimeMicro
NewDateTimeMicro returns a new DateTimeMicro instance. 初始化 DateTimeMicro 结构体
func (DateTimeMicro) MarshalJSON ¶
func (t DateTimeMicro) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface json.Marshal for DateTimeMicro struct. 实现 MarshalJSON 接口
func (*DateTimeMicro) Scan ¶
func (t *DateTimeMicro) Scan(src interface{}) error
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (DateTimeMicro) String ¶
func (t DateTimeMicro) String() string
String implements the interface Stringer for DateTimeMicro struct. 实现 Stringer 接口
func (*DateTimeMicro) UnmarshalJSON ¶
func (t *DateTimeMicro) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface json.Unmarshal for DateTimeMicro struct. 实现 UnmarshalJSON 接口
type DateTimeMilli ¶
type DateTimeMilli struct {
Carbon
}
DateTimeMilli defines a DateTimeMilli struct. 定义 DateTimeMilli 结构体
func NewDateTimeMilli ¶
func NewDateTimeMilli(carbon Carbon) DateTimeMilli
NewDateTimeMilli returns a new DateTimeMilli instance. 初始化 DateTimeMilli 结构体
func (DateTimeMilli) MarshalJSON ¶
func (t DateTimeMilli) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface json.Marshal for DateTimeMilli struct. 实现 MarshalJSON 接口
func (*DateTimeMilli) Scan ¶
func (t *DateTimeMilli) Scan(src interface{}) error
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (DateTimeMilli) String ¶
func (t DateTimeMilli) String() string
String implements the interface Stringer for DateTimeMilli struct. 实现 Stringer 接口
func (*DateTimeMilli) UnmarshalJSON ¶
func (t *DateTimeMilli) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface json.Unmarshal for DateTimeMilli struct. 实现 UnmarshalJSON 接口
type DateTimeNano ¶
type DateTimeNano struct {
Carbon
}
DateTimeNano defines a DateTimeNano struct. 定义 DateTimeNano 结构体
func NewDateTimeNano ¶
func NewDateTimeNano(carbon Carbon) DateTimeNano
NewDateTimeNano returns a new DateTimeNano instance. 初始化 DateTimeNano 结构体
func (DateTimeNano) MarshalJSON ¶
func (t DateTimeNano) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface json.Marshal for DateTimeNano struct. 实现 MarshalJSON 接口
func (*DateTimeNano) Scan ¶
func (t *DateTimeNano) Scan(src interface{}) error
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (DateTimeNano) String ¶
func (t DateTimeNano) String() string
String implements the interface Stringer for DateTimeNano struct. 实现 Stringer 接口
func (*DateTimeNano) UnmarshalJSON ¶
func (t *DateTimeNano) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface json.Unmarshal for DateTimeNano struct. 实现 UnmarshalJSON 接口
type Language ¶
type Language struct { Error error // contains filtered or unexported fields }
Language defines a Language struct. 定义 Language 结构体
func NewLanguage ¶
func NewLanguage() *Language
NewLanguage returns a new Language instance. 初始化 Language 结构体
type Time ¶
type Time struct {
Carbon
}
Time defines a Time struct. 定义 Time 结构体
func (Time) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for Time struct. 实现 MarshalJSON 接口
func (*Time) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for Time struct. 实现 UnmarshalJSON 接口
type TimeMicro ¶
type TimeMicro struct {
Carbon
}
TimeMicro defines a TimeMicro struct. 定义 TimeMicro 结构体
func NewTimeMicro ¶
NewTimeMicro returns a new TimeMicro instance. 初始化 TimeMicro 结构体
func (TimeMicro) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for TimeMicro struct. 实现 MarshalJSON 接口
func (*TimeMicro) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (TimeMicro) String ¶
String implements the interface Stringer for TimeMicro struct. 实现 Stringer 接口
func (*TimeMicro) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for TimeMicro struct. 实现 UnmarshalJSON 接口
type TimeMilli ¶
type TimeMilli struct {
Carbon
}
TimeMilli defines a TimeMilli struct. 定义 TimeMilli 结构体
func NewTimeMilli ¶
NewTimeMilli returns a new TimeMilli instance. 初始化 TimeMilli 结构体
func (TimeMilli) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for TimeMilli struct. 实现 MarshalJSON 接口
func (*TimeMilli) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (TimeMilli) String ¶
String implements the interface Stringer for TimeMilli struct. 实现 Stringer 接口
func (*TimeMilli) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for TimeMilli struct. 实现 UnmarshalJSON 接口
type TimeNano ¶
type TimeNano struct {
Carbon
}
TimeNano defines a TimeNano struct. 定义 TimeNano 结构体
func NewTimeNano ¶
NewTimeNano returns a new TimeNano instance. 初始化 TimeNano 结构体
func (TimeNano) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for TimeNano struct. 实现 MarshalJSON 接口
func (*TimeNano) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (TimeNano) String ¶
String implements the interface Stringer for TimeNano struct. 实现 Stringer 接口
func (*TimeNano) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for TimeNano struct. 实现 UnmarshalJSON 接口
type Timestamp ¶
type Timestamp struct {
Carbon
}
Timestamp defines a Timestamp struct. 定义 Timestamp 结构体
func NewTimestamp ¶
NewTimestamp returns a new Timestamp instance. 初始化 Timestamp 结构体
func (Timestamp) MarshalJSON ¶
MarshalJSON implements the interface json.Marshal for Timestamp struct. 实现 MarshalJSON 接口
func (*Timestamp) Scan ¶
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (Timestamp) String ¶
String implements the interface Stringer for Timestamp struct. 实现 Stringer 接口
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the interface json.Unmarshal for Timestamp struct. 实现 UnmarshalJSON 接口
type TimestampMicro ¶
type TimestampMicro struct {
Carbon
}
TimestampMicro defines a TimestampMicro struct. 定义 TimestampMicro 结构体
func NewTimestampMicro ¶
func NewTimestampMicro(carbon Carbon) TimestampMicro
NewTimestampMicro returns a new TimestampMicro instance. 初始化 TimestampMicro 结构体
func (TimestampMicro) Int64 ¶
func (t TimestampMicro) Int64() int64
Int64 outputs timestamp with microsecond. 输出微秒级时间戳
func (TimestampMicro) MarshalJSON ¶
func (t TimestampMicro) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface MarshalJSON for TimestampMicro struct. 实现 MarshalJSON 接口
func (*TimestampMicro) Scan ¶
func (t *TimestampMicro) Scan(src interface{}) error
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (TimestampMicro) String ¶
func (t TimestampMicro) String() string
String implements the interface Stringer for TimestampMicro struct. 实现 Stringer 接口
func (*TimestampMicro) UnmarshalJSON ¶
func (t *TimestampMicro) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface json.Unmarshal for TimestampMicro struct. 实现 UnmarshalJSON 接口
type TimestampMilli ¶
type TimestampMilli struct {
Carbon
}
TimestampMilli defines a TimestampMilli struct. 定义 TimestampMilli 结构体
func NewTimestampMilli ¶
func NewTimestampMilli(carbon Carbon) TimestampMilli
NewTimestampMilli returns a new TimestampMilli instance. 初始化 TimestampMilli 结构体
func (TimestampMilli) Int64 ¶
func (t TimestampMilli) Int64() int64
Int64 outputs timestamp with millisecond. 输出豪秒级时间戳
func (TimestampMilli) MarshalJSON ¶
func (t TimestampMilli) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface json.Marshal for TimestampMilli struct. 实现 MarshalJSON 接口
func (*TimestampMilli) Scan ¶
func (t *TimestampMilli) Scan(src interface{}) error
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (TimestampMilli) String ¶
func (t TimestampMilli) String() string
String implements the interface Stringer for TimestampMilli struct. 实现 Stringer 接口
func (*TimestampMilli) UnmarshalJSON ¶
func (t *TimestampMilli) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface json.Unmarshal for TimestampMilli struct. 实现 UnmarshalJSON 接口
type TimestampNano ¶
type TimestampNano struct {
Carbon
}
TimestampNano defines a TimestampNano struct. 定义 TimestampNano 结构体
func NewTimestampNano ¶
func NewTimestampNano(carbon Carbon) TimestampNano
NewTimestampNano returns a new TimestampNano instance. 初始化 TimestampNano 结构体
func (TimestampNano) Int64 ¶
func (t TimestampNano) Int64() int64
Int64 outputs timestamp with nanosecond. 输出纳秒级时间戳
func (TimestampNano) MarshalJSON ¶
func (t TimestampNano) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface json.Marshal for TimestampNano struct. 实现 MarshalJSON 接口
func (*TimestampNano) Scan ¶
func (t *TimestampNano) Scan(src interface{}) error
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (TimestampNano) String ¶
func (t TimestampNano) String() string
String implements the interface Stringer for TimestampNano struct. 实现 Stringer 接口
func (*TimestampNano) UnmarshalJSON ¶
func (t *TimestampNano) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface json.Unmarshal for TimestampNano struct. 实现 UnmarshalJSON 接口
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package calendar is part of the carbon package.
|
Package calendar is part of the carbon package. |
julian
Package julian is part of the carbon package.
|
Package julian is part of the carbon package. |
lunar
Package lunar is part of the carbon package.
|
Package lunar is part of the carbon package. |
persian
Package persian is part of the carbon package.
|
Package persian is part of the carbon package. |