Documentation ¶
Overview ¶
Package xtime is a simple, semantic and developer-friendly golang package for datetime.
Index ¶
- Constants
- type Date
- type DateTime
- type Language
- type Time
- type Timestamp
- type TimestampWithMicrosecond
- type TimestampWithMillisecond
- type TimestampWithNanosecond
- type TimestampWithSecond
- type Xtime
- func CreateFromDate(year int, month int, day int, timezone ...string) Xtime
- func CreateFromDateTime(year int, month int, day int, hour int, minute int, second int, ...) Xtime
- func CreateFromTime(hour int, minute int, second int, timezone ...string) Xtime
- func CreateFromTimestamp(timestamp int64, timezone ...string) Xtime
- func NewXtime() Xtime
- func Now(timezone ...string) Xtime
- func Parse(value string, timezone ...string) Xtime
- func ParseByFormat(value string, format string, timezone ...string) Xtime
- func ParseByLayout(value string, layout string, timezone ...string) Xtime
- func SetLanguage(lang *Language) Xtime
- func SetLocale(locale string) Xtime
- func SetTimezone(name string) Xtime
- func Time2Xtime(tt time.Time) Xtime
- func Tomorrow(timezone ...string) Xtime
- func Yesterday(timezone ...string) Xtime
- func (c Xtime) AddCenturies(centuries int) Xtime
- func (c Xtime) AddCenturiesNoOverflow(centuries int) Xtime
- func (c Xtime) AddCentury() Xtime
- func (c Xtime) AddCenturyNoOverflow() Xtime
- func (c Xtime) AddDay() Xtime
- func (c Xtime) AddDays(days int) Xtime
- func (c Xtime) AddDecade() Xtime
- func (c Xtime) AddDecadeNoOverflow() Xtime
- func (c Xtime) AddDecades(decades int) Xtime
- func (c Xtime) AddDecadesNoOverflow(decades int) Xtime
- func (c Xtime) AddDuration(duration string) Xtime
- func (c Xtime) AddHour() Xtime
- func (c Xtime) AddHours(hours int) Xtime
- func (c Xtime) AddMinute() Xtime
- func (c Xtime) AddMinutes(minutes int) Xtime
- func (c Xtime) AddMonth() Xtime
- func (c Xtime) AddMonthNoOverflow() Xtime
- func (c Xtime) AddMonths(months int) Xtime
- func (c Xtime) AddMonthsNoOverflow(months int) Xtime
- func (c Xtime) AddQuarter() Xtime
- func (c Xtime) AddQuarterNoOverflow() Xtime
- func (c Xtime) AddQuarters(quarters int) Xtime
- func (c Xtime) AddQuartersNoOverflow(quarters int) Xtime
- func (c Xtime) AddSecond() Xtime
- func (c Xtime) AddSeconds(seconds int) Xtime
- func (c Xtime) AddWeek() Xtime
- func (c Xtime) AddWeeks(weeks int) Xtime
- func (c Xtime) AddYear() Xtime
- func (c Xtime) AddYearNoOverflow() Xtime
- func (c Xtime) AddYears(years int) Xtime
- func (c Xtime) AddYearsNoOverflow(years int) Xtime
- func (c Xtime) Age() int
- func (c Xtime) Between(start Xtime, end Xtime) bool
- func (c Xtime) BetweenIncludedBoth(start Xtime, end Xtime) bool
- func (c Xtime) BetweenIncludedEnd(start Xtime, end Xtime) bool
- func (c Xtime) BetweenIncludedStart(start Xtime, end Xtime) bool
- func (c Xtime) Century() int
- func (c Xtime) Compare(operator string, t Xtime) bool
- func (c Xtime) Constellation() string
- func (c Xtime) CreateFromDate(year int, month int, day int, timezone ...string) Xtime
- func (c Xtime) CreateFromDateTime(year int, month int, day int, hour int, minute int, second int, ...) Xtime
- func (c Xtime) CreateFromTime(hour int, minute int, second int, timezone ...string) Xtime
- func (c Xtime) CreateFromTimestamp(timestamp int64, timezone ...string) Xtime
- func (c Xtime) Day() int
- func (c Xtime) DayOfMonth() int
- func (c Xtime) DayOfWeek() int
- func (c Xtime) DayOfYear() int
- func (c Xtime) DaysInMonth() int
- func (c Xtime) DaysInYear() int
- func (c Xtime) Decade() int
- func (c Xtime) DiffForHumans(xtime ...Xtime) string
- func (c Xtime) DiffInDays(xtime ...Xtime) int64
- func (c Xtime) DiffInDaysWithAbs(xtime ...Xtime) int64
- func (c Xtime) DiffInHours(xtime ...Xtime) int64
- func (c Xtime) DiffInHoursWithAbs(xtime ...Xtime) int64
- func (c Xtime) DiffInMinutes(xtime ...Xtime) int64
- func (c Xtime) DiffInMinutesWithAbs(xtime ...Xtime) int64
- func (c Xtime) DiffInMonths(xtime ...Xtime) int64
- func (c Xtime) DiffInMonthsWithAbs(xtime ...Xtime) int64
- func (c Xtime) DiffInSeconds(xtime ...Xtime) int64
- func (c Xtime) DiffInSecondsWithAbs(xtime ...Xtime) int64
- func (c Xtime) DiffInString(xtime ...Xtime) string
- func (c Xtime) DiffInStringWithAbs(xtime ...Xtime) string
- func (c Xtime) DiffInWeeks(xtime ...Xtime) int64
- func (c Xtime) DiffInWeeksWithAbs(xtime ...Xtime) int64
- func (c Xtime) DiffInYears(xtime ...Xtime) int64
- func (c Xtime) DiffInYearsWithAbs(xtime ...Xtime) int64
- func (c Xtime) EndOfCentury() Xtime
- func (c Xtime) EndOfDay() Xtime
- func (c Xtime) EndOfDecade() Xtime
- func (c Xtime) EndOfHour() Xtime
- func (c Xtime) EndOfMinute() Xtime
- func (c Xtime) EndOfMonth() Xtime
- func (c Xtime) EndOfQuarter() Xtime
- func (c Xtime) EndOfSeason() Xtime
- func (c Xtime) EndOfSecond() Xtime
- func (c Xtime) EndOfWeek() Xtime
- func (c Xtime) EndOfYear() Xtime
- func (c Xtime) Eq(t Xtime) bool
- func (c Xtime) Format(format string, timezone ...string) string
- func (c Xtime) Gt(t Xtime) bool
- func (c Xtime) Gte(t Xtime) bool
- func (c Xtime) Hour() int
- func (c Xtime) IsApril() bool
- func (c Xtime) IsAquarius() bool
- func (c Xtime) IsAries() bool
- func (c Xtime) IsAugust() bool
- func (c Xtime) IsAutumn() bool
- func (c Xtime) IsCancer() bool
- func (c Xtime) IsCapricorn() bool
- func (c Xtime) IsDecember() bool
- func (c Xtime) IsFebruary() bool
- func (c Xtime) IsFriday() bool
- func (c Xtime) IsFuture() bool
- func (c Xtime) IsGemini() bool
- func (c Xtime) IsInvalid() bool
- func (c Xtime) IsJanuary() bool
- func (c Xtime) IsJuly() bool
- func (c Xtime) IsJune() bool
- func (c Xtime) IsLeapYear() bool
- func (c Xtime) IsLeo() bool
- func (c Xtime) IsLibra() bool
- func (c Xtime) IsLongYear() bool
- func (c Xtime) IsMarch() bool
- func (c Xtime) IsMay() bool
- func (c Xtime) IsMonday() bool
- func (c Xtime) IsNovember() bool
- func (c Xtime) IsNow() bool
- func (c Xtime) IsOctober() bool
- func (c Xtime) IsPast() bool
- func (c Xtime) IsPisces() bool
- func (c Xtime) IsSagittarius() bool
- func (c Xtime) IsSaturday() bool
- func (c Xtime) IsScorpio() bool
- func (c Xtime) IsSeptember() bool
- func (c Xtime) IsSpring() bool
- func (c Xtime) IsSummer() bool
- func (c Xtime) IsSunday() bool
- func (c Xtime) IsTaurus() bool
- func (c Xtime) IsThursday() bool
- func (c Xtime) IsToday() bool
- func (c Xtime) IsTomorrow() bool
- func (c Xtime) IsTuesday() bool
- func (c Xtime) IsVirgo() bool
- func (c Xtime) IsWednesday() bool
- func (c Xtime) IsWeekday() bool
- func (c Xtime) IsWeekend() bool
- func (c Xtime) IsWinter() bool
- func (c Xtime) IsYesterday() bool
- func (c Xtime) IsZero() bool
- func (c Xtime) Layout(layout string, timezone ...string) string
- func (c Xtime) Locale() string
- func (c Xtime) Location() string
- func (c Xtime) Lt(t Xtime) bool
- func (c Xtime) Lte(t Xtime) bool
- func (c Xtime) Lunar() (l lunar)
- func (c Xtime) Microsecond() int
- func (c Xtime) Millisecond() int
- func (c Xtime) Minute() int
- func (c Xtime) Month() int
- func (c Xtime) MonthOfYear() int
- func (c Xtime) Nanosecond() int
- func (c Xtime) Ne(t Xtime) bool
- func (c Xtime) Now(timezone ...string) Xtime
- func (c Xtime) Offset() int
- func (c Xtime) Parse(value string, timezone ...string) Xtime
- func (c Xtime) ParseByFormat(value string, format string, timezone ...string) Xtime
- func (c Xtime) ParseByLayout(value string, layout string, timezone ...string) Xtime
- func (c Xtime) Quarter() (quarter int)
- func (c *Xtime) Scan(v interface{}) error
- func (c Xtime) Season() string
- func (c Xtime) Second() int
- func (c Xtime) SetDay(day int) Xtime
- func (c Xtime) SetHour(hour int) Xtime
- func (c Xtime) SetLanguage(lang *Language) Xtime
- func (c Xtime) SetLocale(locale string) Xtime
- func (c Xtime) SetMicrosecond(microsecond int) Xtime
- func (c Xtime) SetMillisecond(millisecond int) Xtime
- func (c Xtime) SetMinute(minute int) Xtime
- func (c Xtime) SetMonth(month int) Xtime
- func (c Xtime) SetMonthNoOverflow(month int) Xtime
- func (c Xtime) SetNanosecond(nanosecond int) Xtime
- func (c Xtime) SetSecond(second int) Xtime
- func (c Xtime) SetTimezone(name string) Xtime
- func (c Xtime) SetWeekStartsAt(day string) Xtime
- func (c Xtime) SetYear(year int) Xtime
- func (c Xtime) SetYearNoOverflow(year int) Xtime
- func (c Xtime) StartOfCentury() Xtime
- func (c Xtime) StartOfDay() Xtime
- func (c Xtime) StartOfDecade() Xtime
- func (c Xtime) StartOfHour() Xtime
- func (c Xtime) StartOfMinute() Xtime
- func (c Xtime) StartOfMonth() Xtime
- func (c Xtime) StartOfQuarter() Xtime
- func (c Xtime) StartOfSeason() Xtime
- func (c Xtime) StartOfSecond() Xtime
- func (c Xtime) StartOfWeek() Xtime
- func (c Xtime) StartOfYear() Xtime
- func (c Xtime) String() string
- func (c Xtime) SubCenturies(centuries int) Xtime
- func (c Xtime) SubCenturiesNoOverflow(centuries int) Xtime
- func (c Xtime) SubCentury() Xtime
- func (c Xtime) SubCenturyNoOverflow() Xtime
- func (c Xtime) SubDay() Xtime
- func (c Xtime) SubDays(days int) Xtime
- func (c Xtime) SubDecade() Xtime
- func (c Xtime) SubDecadeNoOverflow() Xtime
- func (c Xtime) SubDecades(decades int) Xtime
- func (c Xtime) SubDecadesNoOverflow(decades int) Xtime
- func (c Xtime) SubDuration(duration string) Xtime
- func (c Xtime) SubHour() Xtime
- func (c Xtime) SubHours(hours int) Xtime
- func (c Xtime) SubMinute() Xtime
- func (c Xtime) SubMinutes(minutes int) Xtime
- func (c Xtime) SubMonth() Xtime
- func (c Xtime) SubMonthNoOverflow() Xtime
- func (c Xtime) SubMonths(months int) Xtime
- func (c Xtime) SubMonthsNoOverflow(months int) Xtime
- func (c Xtime) SubQuarter() Xtime
- func (c Xtime) SubQuarterNoOverflow() Xtime
- func (c Xtime) SubQuarters(quarters int) Xtime
- func (c Xtime) SubQuartersNoOverflow(quarters int) Xtime
- func (c Xtime) SubSecond() Xtime
- func (c Xtime) SubSeconds(seconds int) Xtime
- func (c Xtime) SubWeek() Xtime
- func (c Xtime) SubWeeks(weeks int) Xtime
- func (c Xtime) SubYear() Xtime
- func (c Xtime) SubYearNoOverflow() Xtime
- func (c Xtime) SubYears(years int) Xtime
- func (c Xtime) SubYearsNoOverflow(years int) Xtime
- func (c Xtime) Timestamp() int64
- func (c Xtime) TimestampWithMicrosecond() int64
- func (c Xtime) TimestampWithMillisecond() int64
- func (c Xtime) TimestampWithNanosecond() int64
- func (c Xtime) TimestampWithSecond() int64
- func (c Xtime) Timezone() string
- func (c Xtime) ToAnsicString(timezone ...string) string
- func (c Xtime) ToAtomString(timezone ...string) string
- func (c Xtime) ToCookieString(timezone ...string) string
- func (c Xtime) ToDateString(timezone ...string) string
- func (c Xtime) ToDateTimeString(timezone ...string) string
- func (c Xtime) ToDayDateTimeString(timezone ...string) string
- func (c Xtime) ToFormatString(format string, timezone ...string) string
- func (c Xtime) ToIso8601String(timezone ...string) string
- func (c Xtime) ToKitchenString(timezone ...string) string
- func (c Xtime) ToLayoutString(layout string, timezone ...string) string
- func (c Xtime) ToMonthString(timezone ...string) string
- func (c Xtime) ToRfc1036String(timezone ...string) string
- func (c Xtime) ToRfc1123String(timezone ...string) string
- func (c Xtime) ToRfc1123zString(timezone ...string) string
- func (c Xtime) ToRfc2822String(timezone ...string) string
- func (c Xtime) ToRfc3339String(timezone ...string) string
- func (c Xtime) ToRfc7231String(timezone ...string) string
- func (c Xtime) ToRfc822String(timezone ...string) string
- func (c Xtime) ToRfc822zString(timezone ...string) string
- func (c Xtime) ToRfc850String(timezone ...string) string
- func (c Xtime) ToRssString(timezone ...string) string
- func (c Xtime) ToRubyDateString(timezone ...string) string
- func (c Xtime) ToShortDateString(timezone ...string) string
- func (c Xtime) ToShortDateTimeString(timezone ...string) string
- func (c Xtime) ToShortMonthString(timezone ...string) string
- func (c Xtime) ToShortTimeString(timezone ...string) string
- func (c Xtime) ToShortWeekString(timezone ...string) string
- func (c Xtime) ToString(timezone ...string) string
- func (c Xtime) ToTimeString(timezone ...string) string
- func (c Xtime) ToUnixDateString(timezone ...string) string
- func (c Xtime) ToW3cString(timezone ...string) string
- func (c Xtime) ToWeekString(timezone ...string) string
- func (c Xtime) Tomorrow(timezone ...string) Xtime
- func (c Xtime) Value() (driver.Value, error)
- func (c Xtime) Week() int
- func (c Xtime) WeekOfMonth() int
- func (c Xtime) WeekOfYear() int
- func (c Xtime) Xtime2Time() time.Time
- func (c Xtime) Year() int
- func (c Xtime) Yesterday(timezone ...string) Xtime
Constants ¶
const ( Local = "Local" CET = "CET" EET = "EET" EST = "EST" GMT = "GMT" UTC = "UTC" UCT = "UCT" 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" // 哈尔滨 HongKong = "Asia/Hong_Kong" // 香港 Macao = "Asia/Macao" // 澳门 Taipei = "Asia/Taipei" // 台北 Tokyo = "Asia/Tokyo" // 东京 Saigon = "Asia/Saigon" // 西贡 Seoul = "Asia/Seoul" // 首尔 Bangkok = "Asia/Bangkok" // 曼谷 Dubai = "Asia/Dubai" // 迪拜 NewYork = "America/New_York" // 纽约 LosAngeles = "America/Los_Angeles" // 洛杉矶 Chicago = "America/Chicago" // 芝加哥 Moscow = "Europe/Moscow" // 莫斯科 London = "Europe/London" // 伦敦 Berlin = "Europe/Berlin" // 柏林 Paris = "Europe/Paris" // 巴黎 Rome = "Europe/Rome" // 罗马 )
timezones constant 时区常量
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" // 十二月 )
months constant 月份常量
const ( Monday = "Monday" // 周一 Tuesday = "Tuesday" // 周二 Wednesday = "Wednesday" // 周三 Thursday = "Thursday" // 周四 Friday = "Friday" // 周五 Saturday = "Saturday" // 周六 Sunday = "Sunday" // 周日 )
weeks constant 星期常量
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秒 MillisecondsPerSecond = 1000 // 每秒1000毫秒 MicrosecondsPerMillisecond = 1000 // 每毫秒1000微秒 MicrosecondsPerSecond = 1000000 // 每秒1000000微秒 )
numbers constant 数字常量
const ( AnsicFormat = time.ANSIC UnixDateFormat = time.UnixDate RubyDateFormat = time.RubyDate RFC822Format = time.RFC822 RFC822ZFormat = time.RFC822Z RFC850Format = time.RFC850 RFC1123Format = time.RFC1123 RFC1123ZFormat = time.RFC1123Z RssFormat = time.RFC1123Z RFC2822Format = time.RFC1123Z RFC3339Format = time.RFC3339 KitchenFormat = time.Kitchen CookieFormat = "Monday, 02-Jan-2006 15:04:05 MST" ISO8601Format = "2006-01-02T15:04:05-07:00" RFC1036Format = "Mon, 02 Jan 06 15:04:05 -0700" RFC7231Format = "Mon, 02 Jan 2006 15:04:05 GMT" DayDateTimeFormat = "Mon, Jan 2, 2006 3:04 PM" DateTimeFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" TimeFormat = "15:04:05" ShortDateTimeFormat = "20060102150405" ShortDateFormat = "20060102" ShortTimeFormat = "150405" )
formats constant 时间格式化常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
type Date struct {
Xtime
}
Date defines a Date struct.
func (Date) MarshalJSON ¶
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
type DateTime ¶
type DateTime struct {
Xtime
}
DateTime defines a DateTime struct.
func (DateTime) MarshalJSON ¶
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
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 结构体
func (*Language) SetResources ¶
SetResources sets language resources. 设置资源
type Time ¶
type Time struct {
Xtime
}
Time defines a Time struct.
func (Time) MarshalJSON ¶
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
type Timestamp ¶
type Timestamp struct {
Xtime
}
Timestamp defines a Timestamp struct.
func (Timestamp) MarshalJSON ¶
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
type TimestampWithMicrosecond ¶
type TimestampWithMicrosecond struct {
Xtime
}
TimestampWithMicrosecond defines a TimestampWithMicrosecond struct.
func (TimestampWithMicrosecond) MarshalJSON ¶
func (t TimestampWithMicrosecond) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*TimestampWithMicrosecond) UnmarshalJSON ¶
func (t *TimestampWithMicrosecond) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
type TimestampWithMillisecond ¶
type TimestampWithMillisecond struct {
Xtime
}
TimestampWithMillisecond defines a TimestampWithMillisecond struct.
func (TimestampWithMillisecond) MarshalJSON ¶
func (t TimestampWithMillisecond) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*TimestampWithMillisecond) UnmarshalJSON ¶
func (t *TimestampWithMillisecond) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
type TimestampWithNanosecond ¶
type TimestampWithNanosecond struct {
Xtime
}
TimestampWithNanosecond defines a TimestampWithNanosecond struct.
func (TimestampWithNanosecond) MarshalJSON ¶
func (t TimestampWithNanosecond) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*TimestampWithNanosecond) UnmarshalJSON ¶
func (t *TimestampWithNanosecond) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
type TimestampWithSecond ¶
type TimestampWithSecond struct {
Xtime
}
TimestampWithSecond defines a TimestampWithSecond struct.
func (TimestampWithSecond) MarshalJSON ¶
func (t TimestampWithSecond) MarshalJSON() ([]byte, error)
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*TimestampWithSecond) UnmarshalJSON ¶
func (t *TimestampWithSecond) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
type Xtime ¶ added in v0.0.3
type Xtime struct { Error error // contains filtered or unexported fields }
Xtime defines a Xtime struct. 定义 Xtime 结构体
func CreateFromDate ¶
CreateFromDate creates a Xtime instance from a given date. 从给定的年月日创建 Xtime 实例
func CreateFromDateTime ¶
func CreateFromDateTime(year int, month int, day int, hour int, minute int, second int, timezone ...string) Xtime
CreateFromDateTime creates a Xtime instance from a given date and time. 从给定的年月日时分秒创建 Xtime 实例
func CreateFromTime ¶
CreateFromTime creates a Xtime instance from a given time. 从给定的时分秒创建 Xtime 实例
func CreateFromTimestamp ¶
CreateFromTimestamp creates a Xtime instance from a given timestamp. 从给定的时间戳创建 Xtime 实例
func NewXtime ¶ added in v0.0.3
func NewXtime() Xtime
NewXtime returns a new Xtime instance. 初始化 Xtime 结构体
func ParseByFormat ¶
ParseByFormat parses a string as a Xtime instance by format. 通过布局字符将字符串解析成 xtime 实例
func ParseByLayout ¶
ParseByLayout parses a string as a Xtime instance by layout. 将布局时间字符串解析成 Xtime 实例
func Time2Xtime ¶ added in v0.0.3
Time2Xtime converts time.Time to Xtime. 将 time.Time 转换成 Xtime
func (Xtime) AddCenturies ¶ added in v0.0.3
AddCenturies adds some centuries. N个世纪后
func (Xtime) AddCenturiesNoOverflow ¶ added in v0.0.3
AddCenturiesNoOverflow adds some centuries without overflowing month. N个世纪后(月份不溢出)
func (Xtime) AddCentury ¶ added in v0.0.3
AddCentury adds one century. 1个世纪后
func (Xtime) AddCenturyNoOverflow ¶ added in v0.0.3
AddCenturyNoOverflow adds one century without overflowing month. 1个世纪后(月份不溢出)
func (Xtime) AddDecadeNoOverflow ¶ added in v0.0.3
AddDecadeNoOverflow adds one decade without overflowing month. 1个年代后(月份不溢出)
func (Xtime) AddDecades ¶ added in v0.0.3
AddDecades adds some decades. N个年代后
func (Xtime) AddDecadesNoOverflow ¶ added in v0.0.3
AddDecadesNoOverflow adds some decades without overflowing month. N个年代后(月份不溢出)
func (Xtime) AddDuration ¶ added in v0.0.3
AddDuration adds one duration. 按照持续时长字符串增加时间,支持整数/浮点数和符号ns(纳秒)、us(微妙)、ms(毫秒)、s(秒)、m(分钟)、h(小时)的组合
func (Xtime) AddMinutes ¶ added in v0.0.3
AddMinutes adds some minutes. N分钟后
func (Xtime) AddMonthNoOverflow ¶ added in v0.0.3
AddMonthNoOverflow adds one month without overflowing month. 1个月后(月份不溢出)
func (Xtime) AddMonthsNoOverflow ¶ added in v0.0.3
AddMonthsNoOverflow adds some months without overflowing month. N个月后(月份不溢出)
func (Xtime) AddQuarter ¶ added in v0.0.3
AddQuarter adds one quarter 1个季度后
func (Xtime) AddQuarterNoOverflow ¶ added in v0.0.3
AddQuarterNoOverflow adds one quarter without overflowing month. 1个季度后(月份不溢出)
func (Xtime) AddQuarters ¶ added in v0.0.3
AddQuarters adds some quarters N个季度后
func (Xtime) AddQuartersNoOverflow ¶ added in v0.0.3
AddQuartersNoOverflow adds quarters without overflowing month. N个季度后(月份不溢出)
func (Xtime) AddSeconds ¶ added in v0.0.3
AddSeconds adds some seconds. N秒钟后
func (Xtime) AddYearNoOverflow ¶ added in v0.0.3
AddYearNoOverflow adds one year without overflowing month. 1年后(月份不溢出)
func (Xtime) AddYearsNoOverflow ¶ added in v0.0.3
AddYearsNoOverflow adds some years without overflowing month. N年后(月份不溢出)
func (Xtime) Between ¶ added in v0.0.3
Between reports whether between two times, excluded the start and end time. 是否在两个时间之间(不包括这两个时间)
func (Xtime) BetweenIncludedBoth ¶ added in v0.0.3
BetweenIncludedBoth reports whether between two times, included the start and end time. 是否在两个时间之间(包括这两个时间)
func (Xtime) BetweenIncludedEnd ¶ added in v0.0.3
BetweenIncludedEnd reports whether between two times, included the end time. 是否在两个时间之间(包括结束时间)
func (Xtime) BetweenIncludedStart ¶ added in v0.0.3
BetweenIncludedStart reports whether between two times, included the start time. 是否在两个时间之间(包括开始时间)
func (Xtime) Constellation ¶ added in v0.0.3
Constellation gets constellation name, i18n is supported. 获取星座,支持i18n
func (Xtime) CreateFromDate ¶ added in v0.0.3
CreateFromDate creates a Xtime instance from a given date. 从给定的年月日创建 Xtime 实例
func (Xtime) CreateFromDateTime ¶ added in v0.0.3
func (c Xtime) CreateFromDateTime(year int, month int, day int, hour int, minute int, second int, timezone ...string) Xtime
CreateFromDateTime creates a Xtime instance from a given date and time. 从给定的年月日时分秒创建 Xtime 实例
func (Xtime) CreateFromTime ¶ added in v0.0.3
CreateFromTime creates a Xtime instance from a given time. 从给定的时分秒创建 Xtime 实例
func (Xtime) CreateFromTimestamp ¶ added in v0.0.3
CreateFromTimestamp creates a Xtime instance from a given timestamp, second, millisecond, microsecond and nanosecond are supported. 从给定的时间戳创建 Xtime 实例,支持秒、毫秒、微秒和纳秒
func (Xtime) DayOfMonth ¶ added in v0.0.3
DayOfMonth gets day of month. 获取本月的第几天
func (Xtime) DaysInMonth ¶ added in v0.0.3
DaysInMonth gets total days in month. 获取本月的总天数
func (Xtime) DaysInYear ¶ added in v0.0.3
DaysInYear gets total days in year. 获取本年的总天数
func (Xtime) DiffForHumans ¶ added in v0.0.3
DiffForHumans gets the difference in a human-readable format, i18n is supported. 获取对人类友好的可读格式时间差,支持i18n
func (Xtime) DiffInDays ¶ added in v0.0.3
DiffInDays gets the difference in days. 相差多少天
func (Xtime) DiffInDaysWithAbs ¶ added in v0.0.3
DiffInDaysWithAbs gets the difference in days with absolute value. 相差多少天(绝对值)
func (Xtime) DiffInHours ¶ added in v0.0.3
DiffInHours gets the difference in hours. 相差多少小时
func (Xtime) DiffInHoursWithAbs ¶ added in v0.0.3
DiffInHoursWithAbs gets the difference in hours with absolute value. 相差多少小时(绝对值)
func (Xtime) DiffInMinutes ¶ added in v0.0.3
DiffInMinutes gets the difference in minutes. 相差多少分钟
func (Xtime) DiffInMinutesWithAbs ¶ added in v0.0.3
DiffInMinutesWithAbs gets the difference in minutes with absolute value. 相差多少分钟(绝对值)
func (Xtime) DiffInMonths ¶ added in v0.0.3
DiffInMonths gets the difference in months. 相差多少月
func (Xtime) DiffInMonthsWithAbs ¶ added in v0.0.3
DiffInMonthsWithAbs gets the difference in months with absolute value. 相差多少月(绝对值)
func (Xtime) DiffInSeconds ¶ added in v0.0.3
DiffInSeconds gets the difference in seconds. 相差多少秒
func (Xtime) DiffInSecondsWithAbs ¶ added in v0.0.3
DiffInSecondsWithAbs gets the difference in seconds with absolute value. 相差多少秒(绝对值)
func (Xtime) DiffInString ¶ added in v0.0.3
DiffInString gets the difference in string, i18n is supported. 相差字符串,支持i18n
func (Xtime) DiffInStringWithAbs ¶ added in v0.0.3
DiffInStringWithAbs gets the difference in string with absolute value, i18n is supported. 相差字符串,支持i18n(绝对值)
func (Xtime) DiffInWeeks ¶ added in v0.0.3
DiffInWeeks gets the difference in weeks. 相差多少周
func (Xtime) DiffInWeeksWithAbs ¶ added in v0.0.3
DiffInWeeksWithAbs gets the difference in weeks with absolute value. 相差多少周(绝对值)
func (Xtime) DiffInYears ¶ added in v0.0.3
DiffInYears gets the difference in years. 相差多少年
func (Xtime) DiffInYearsWithAbs ¶ added in v0.0.3
DiffInYearsWithAbs gets the difference in years with absolute value. 相差多少年(绝对值)
func (Xtime) EndOfCentury ¶ added in v0.0.3
EndOfCentury returns a Xtime instance for end of the century. 本世纪结束时间
func (Xtime) EndOfDay ¶ added in v0.0.3
EndOfDay returns a Xtime instance for end of the day. 本日结束时间
func (Xtime) EndOfDecade ¶ added in v0.0.3
EndOfDecade returns a Xtime instance for end of the decade. 本年代结束时间
func (Xtime) EndOfHour ¶ added in v0.0.3
EndOfHour returns a Xtime instance for end of the hour. 小时结束时间
func (Xtime) EndOfMinute ¶ added in v0.0.3
EndOfMinute returns a Xtime instance for end of the minute. 分钟结束时间
func (Xtime) EndOfMonth ¶ added in v0.0.3
EndOfMonth returns a Xtime instance for end of the month. 本月结束时间
func (Xtime) EndOfQuarter ¶ added in v0.0.3
EndOfQuarter returns a Xtime instance for end of the quarter. 本季度结束时间
func (Xtime) EndOfSeason ¶ added in v0.0.3
EndOfSeason returns a Xtime instance for end of the season. 本季节结束时间
func (Xtime) EndOfSecond ¶ added in v0.0.3
EndOfSecond returns a Xtime instance for end of the second. 秒结束时间
func (Xtime) EndOfWeek ¶ added in v0.0.3
EndOfWeek returns a Xtime instance for end of the week. 本周结束时间
func (Xtime) EndOfYear ¶ added in v0.0.3
EndOfYear returns a Xtime instance for end of the year. 本年结束时间
func (Xtime) Format ¶ added in v0.0.3
Format outputs a string by format, it is shorthand for ToFormatString. 输出指定格式的时间字符串, 是 ToFormatString 的简写
func (Xtime) IsAquarius ¶ added in v0.0.3
IsAquarius reports whether is Aquarius. 是否是水瓶座
func (Xtime) IsCapricorn ¶ added in v0.0.3
IsCapricorn reports whether is Capricorn. 是否是摩羯座
func (Xtime) IsDecember ¶ added in v0.0.3
IsDecember reports whether is December. 是否是十二月
func (Xtime) IsFebruary ¶ added in v0.0.3
IsFebruary reports whether is February. 是否是二月
func (Xtime) IsLeapYear ¶ added in v0.0.3
IsLeapYear reports whether is a leap year. 是否是闰年
func (Xtime) IsLongYear ¶ added in v0.0.3
IsLongYear reports whether is a long year, see https://en.wikipedia.org/wiki/ISO_8601#Week_dates. 是否是长年
func (Xtime) IsNovember ¶ added in v0.0.3
IsNovember reports whether is November. 是否是十一月
func (Xtime) IsSagittarius ¶ added in v0.0.3
IsSagittarius reports whether is Sagittarius. 是否是射手座
func (Xtime) IsSaturday ¶ added in v0.0.3
IsSaturday reports whether is Saturday. 是否是周六
func (Xtime) IsSeptember ¶ added in v0.0.3
IsSeptember reports whether is September. 是否是九月
func (Xtime) IsThursday ¶ added in v0.0.3
IsThursday reports whether is Thursday. 是否是周四
func (Xtime) IsTomorrow ¶ added in v0.0.3
IsTomorrow reports whether is tomorrow. 是否是明天
func (Xtime) IsWednesday ¶ added in v0.0.3
IsWednesday reports whether is Wednesday. 是否是周三
func (Xtime) IsYesterday ¶ added in v0.0.3
IsYesterday reports whether is yesterday. 是否是昨天
func (Xtime) Layout ¶ added in v0.0.3
Layout outputs a string by layout, it is shorthand for ToLayoutString. 输出指定布局的时间字符串, 是 ToLayoutString 的简写
func (Xtime) Lunar ¶ added in v0.0.3
func (c Xtime) Lunar() (l lunar)
Lunar converts the gregorian calendar to the lunar calendar. 将公历转为农历
func (Xtime) Microsecond ¶ added in v0.0.3
Microsecond gets current microsecond. 获取当前微秒数,6位数字
func (Xtime) Millisecond ¶ added in v0.0.3
Millisecond gets current millisecond. 获取当前毫秒数,3位数字
func (Xtime) MonthOfYear ¶ added in v0.0.3
MonthOfYear gets month of year. 获取本年的第几月
func (Xtime) Nanosecond ¶ added in v0.0.3
Nanosecond gets current nanosecond. 获取当前纳秒数,9位数字
func (Xtime) Offset ¶ added in v0.0.3
Offset gets offset seconds from the UTC timezone. 获取距离UTC时区的偏移量,单位秒
func (Xtime) Parse ¶ added in v0.0.3
Parse parses a standard string as a Xtime instance. 将标准格式时间字符串解析成 Xtime 实例
func (Xtime) ParseByFormat ¶ added in v0.0.3
ParseByFormat parses a string as a Xtime instance by format. 通过格式化字符将字符串解析成 xtime 实例
func (Xtime) ParseByLayout ¶ added in v0.0.3
ParseByLayout parses a string as a Xtime instance by layout. 通过布局字符将字符串解析成 xtime 实例
func (*Xtime) Scan ¶ added in v0.0.3
Scan an interface used by Scan in package database/sql for Scanning value from database to local golang variable.
func (Xtime) Season ¶ added in v0.0.3
Season gets season name according to the meteorological division method, i18n is supported. 获取当前季节(以气象划分),支持i18n
func (Xtime) SetLanguage ¶ added in v0.0.3
SetLanguage sets language. 设置语言对象
func (Xtime) SetMicrosecond ¶ added in v0.0.3
SetMicrosecond sets microsecond. 设置微秒
func (Xtime) SetMillisecond ¶ added in v0.0.3
SetMillisecond sets millisecond. 设置毫秒
func (Xtime) SetMonthNoOverflow ¶ added in v0.0.3
SetMonthNoOverflow sets month without overflowing month. 设置月份(月份不溢出)
func (Xtime) SetNanosecond ¶ added in v0.0.3
SetNanosecond sets nanosecond. 设置纳秒
func (Xtime) SetTimezone ¶ added in v0.0.3
SetTimezone sets timezone. 设置时区
func (Xtime) SetWeekStartsAt ¶ added in v0.0.3
SetWeekStartsAt sets start day of the week. 设置一周的开始日期
func (Xtime) SetYearNoOverflow ¶ added in v0.0.3
SetYearNoOverflow sets year without overflowing month. 设置年份(月份不溢出)
func (Xtime) StartOfCentury ¶ added in v0.0.3
StartOfCentury returns a Xtime instance for start of the century. 本世纪开始时间
func (Xtime) StartOfDay ¶ added in v0.0.3
StartOfDay returns a Xtime instance for start of the day. 本日开始时间
func (Xtime) StartOfDecade ¶ added in v0.0.3
StartOfDecade returns a Xtime instance for start of the decade. 本年代开始时间
func (Xtime) StartOfHour ¶ added in v0.0.3
StartOfHour returns a Xtime instance for start of the hour. 小时开始时间
func (Xtime) StartOfMinute ¶ added in v0.0.3
StartOfMinute returns a Xtime instance for start of the minute. 分钟开始时间
func (Xtime) StartOfMonth ¶ added in v0.0.3
StartOfMonth returns a Xtime instance for start of the month. 本月开始时间
func (Xtime) StartOfQuarter ¶ added in v0.0.3
StartOfQuarter returns a Xtime instance for start of the quarter. 本季度开始时间
func (Xtime) StartOfSeason ¶ added in v0.0.3
StartOfSeason returns a Xtime instance for start of the season. 本季节开始时间
func (Xtime) StartOfSecond ¶ added in v0.0.3
StartOfSecond returns a Xtime instance for start of the second. 秒开始时间
func (Xtime) StartOfWeek ¶ added in v0.0.3
StartOfWeek returns a Xtime instance for start of the week. 本周开始时间
func (Xtime) StartOfYear ¶ added in v0.0.3
StartOfYear returns a Xtime instance for start of the year. 本年开始时间
func (Xtime) String ¶ added in v0.0.3
String outputs a string in date and time format, implement Stringer interface. 实现 Stringer 接口
func (Xtime) SubCenturies ¶ added in v0.0.3
SubCenturies subtracts some centuries. N个世纪前
func (Xtime) SubCenturiesNoOverflow ¶ added in v0.0.3
SubCenturiesNoOverflow subtracts some centuries without overflowing month. N个世纪前(月份不溢出)
func (Xtime) SubCentury ¶ added in v0.0.3
SubCentury subtracts one century. 1个世纪前
func (Xtime) SubCenturyNoOverflow ¶ added in v0.0.3
SubCenturyNoOverflow subtracts one century without overflowing month. 1个世纪前(月份不溢出)
func (Xtime) SubDecadeNoOverflow ¶ added in v0.0.3
SubDecadeNoOverflow subtracts one decade without overflowing month. 1个年代后(月份不溢出)
func (Xtime) SubDecades ¶ added in v0.0.3
SubDecades subtracts some decades. N个年代后
func (Xtime) SubDecadesNoOverflow ¶ added in v0.0.3
SubDecadesNoOverflow subtracts some decades without overflowing month. N个年代后(月份不溢出)
func (Xtime) SubDuration ¶ added in v0.0.3
SubDuration subtracts one duration. 按照持续时长字符串减少时间,支持整数/浮点数和符号ns(纳秒)、us(微妙)、ms(毫秒)、s(秒)、m(分钟)、h(小时)的组合
func (Xtime) SubMinutes ¶ added in v0.0.3
SubMinutes subtracts some minutes. N分钟前
func (Xtime) SubMonthNoOverflow ¶ added in v0.0.3
SubMonthNoOverflow subtracts one month without overflowing month. 1个月前(月份不溢出)
func (Xtime) SubMonthsNoOverflow ¶ added in v0.0.3
SubMonthsNoOverflow subtracts some months without overflowing month. N个月前(月份不溢出)
func (Xtime) SubQuarter ¶ added in v0.0.3
SubQuarter subtracts one quarter. 1个季度前
func (Xtime) SubQuarterNoOverflow ¶ added in v0.0.3
SubQuarterNoOverflow subtracts one quarter without overflowing month. 1个季度前(月份不溢出)
func (Xtime) SubQuarters ¶ added in v0.0.3
SubQuarters subtracts some quarters. N个季度前
func (Xtime) SubQuartersNoOverflow ¶ added in v0.0.3
SubQuartersNoOverflow subtracts some quarters without overflowing month. N个季度前(月份不溢出)
func (Xtime) SubSeconds ¶ added in v0.0.3
SubSeconds subtracts some seconds. N秒钟前
func (Xtime) SubYearNoOverflow ¶ added in v0.0.3
SubYearNoOverflow subtracts one year without overflowing month. 1年前(月份不溢出)
func (Xtime) SubYearsNoOverflow ¶ added in v0.0.3
SubYearsNoOverflow subtracts some years without overflowing month. N年前(月份不溢出)
func (Xtime) Timestamp ¶ added in v0.0.3
Timestamp gets timestamp with second, it is shorthand for TimestampWithSecond. 获取秒级时间戳, 是 TimestampWithSecond 的简写
func (Xtime) TimestampWithMicrosecond ¶ added in v0.0.3
TimestampWithMicrosecond gets timestamp with microsecond. 获取微秒级时间戳
func (Xtime) TimestampWithMillisecond ¶ added in v0.0.3
TimestampWithMillisecond gets timestamp with millisecond. 获取毫秒级时间戳
func (Xtime) TimestampWithNanosecond ¶ added in v0.0.3
TimestampWithNanosecond gets timestamp with nanosecond. 获取纳秒级时间戳
func (Xtime) TimestampWithSecond ¶ added in v0.0.3
TimestampWithSecond gets timestamp with second. 输出秒级时间戳
func (Xtime) ToAnsicString ¶ added in v0.0.3
ToAnsicString outputs a string in ANSIC format. 输出 ANSIC 格式字符串
func (Xtime) ToAtomString ¶ added in v0.0.3
ToAtomString outputs a string in ATOM format. 输出 ATOM 格式字符串
func (Xtime) ToCookieString ¶ added in v0.0.3
ToCookieString outputs a string in COOKIE format. 输出 COOKIE 格式字符串
func (Xtime) ToDateString ¶ added in v0.0.3
ToDateString outputs a string in date format. 输出日期字符串
func (Xtime) ToDateTimeString ¶ added in v0.0.3
ToDateTimeString outputs a string in date and time format. 输出日期时间字符串
func (Xtime) ToDayDateTimeString ¶ added in v0.0.3
ToDayDateTimeString outputs a string in day, date and time format. 输出天数日期时间字符串
func (Xtime) ToFormatString ¶ added in v0.0.3
ToFormatString outputs a string by format. 输出指定格式的时间字符串
func (Xtime) ToIso8601String ¶ added in v0.0.3
ToIso8601String outputs a string in ISO8601 format. 输出 ISO8601 格式字符串
func (Xtime) ToKitchenString ¶ added in v0.0.3
ToKitchenString outputs a string in KITCHEN format. 输出 KITCHEN 格式字符串
func (Xtime) ToLayoutString ¶ added in v0.0.3
ToLayoutString outputs a string by layout. 输出指定布局的时间字符串
func (Xtime) ToMonthString ¶ added in v0.0.3
ToMonthString outputs a string in month format, i18n is supported. 输出完整月份字符串,支持i18n
func (Xtime) ToRfc1036String ¶ added in v0.0.3
ToRfc1036String outputs a string in RFC1036 format. 输出 RFC1036 格式字符串
func (Xtime) ToRfc1123String ¶ added in v0.0.3
ToRfc1123String outputs a string in RFC1123 format. 输出 RFC1123 格式字符串
func (Xtime) ToRfc1123zString ¶ added in v0.0.3
ToRfc1123zString outputs a string in RFC1123z format. 输出 RFC1123z 格式字符串
func (Xtime) ToRfc2822String ¶ added in v0.0.3
ToRfc2822String outputs a string in RFC2822 format. 输出 RFC2822 格式字符串
func (Xtime) ToRfc3339String ¶ added in v0.0.3
ToRfc3339String outputs a string in RFC3339 format. 输出 RFC3339 格式字符串
func (Xtime) ToRfc7231String ¶ added in v0.0.3
ToRfc7231String outputs a string in RFC7231 format. 输出 RFC7231 格式字符串
func (Xtime) ToRfc822String ¶ added in v0.0.3
ToRfc822String outputs a string in RFC822 format. 输出 RFC822 格式字符串
func (Xtime) ToRfc822zString ¶ added in v0.0.3
ToRfc822zString outputs a string in RFC822Z format. 输出 RFC822Z 格式字符串
func (Xtime) ToRfc850String ¶ added in v0.0.3
ToRfc850String outputs a string in RFC850 format. 输出 RFC850 格式字符串
func (Xtime) ToRssString ¶ added in v0.0.3
ToRssString outputs a string in RSS format. 输出 RSS 格式字符串
func (Xtime) ToRubyDateString ¶ added in v0.0.3
ToRubyDateString outputs a string in ruby date format. 输出 RubyDate 格式字符串
func (Xtime) ToShortDateString ¶ added in v0.0.3
ToShortDateString outputs a string in short date format. 输出简写日期字符串
func (Xtime) ToShortDateTimeString ¶ added in v0.0.3
ToShortDateTimeString outputs a string in short date and time format. 输出简写日期时间字符串
func (Xtime) ToShortMonthString ¶ added in v0.0.3
ToShortMonthString outputs a string in short month format, i18n is supported. 输出缩写月份字符串,支持i18n
func (Xtime) ToShortTimeString ¶ added in v0.0.3
ToShortTimeString outputs a string in short time format. 输出简写时间字符串
func (Xtime) ToShortWeekString ¶ added in v0.0.3
ToShortWeekString outputs a string in short week format, i18n is supported. 输出缩写星期字符串,支持i18n
func (Xtime) ToString ¶ added in v0.0.3
ToString outputs a string in "2006-01-02 15:04:05.999999999 -0700 MST" format. 输出"2006-01-02 15:04:05.999999999 -0700 MST"格式字符串
func (Xtime) ToTimeString ¶ added in v0.0.3
ToTimeString outputs a string in time format. 输出时间字符串
func (Xtime) ToUnixDateString ¶ added in v0.0.3
ToUnixDateString outputs a string in unix date format. 输出 UnixDate 格式字符串
func (Xtime) ToW3cString ¶ added in v0.0.3
ToW3cString outputs a string in W3C format. 输出 W3C 格式字符串
func (Xtime) ToWeekString ¶ added in v0.0.3
ToWeekString outputs a string in week format, i18n is supported. 输出完整星期字符串,支持i18n
func (Xtime) Value ¶ added in v0.0.3
Value the interface providing the Value method for package database/sql/driver.
func (Xtime) WeekOfMonth ¶ added in v0.0.3
WeekOfMonth gets week of month. 获取本月的第几周
func (Xtime) WeekOfYear ¶ added in v0.0.3
WeekOfYear gets week of year, see https://en.wikipedia.org/wiki/ISO_8601#Week_dates. 获取本年的第几周
func (Xtime) Xtime2Time ¶ added in v0.0.3
Xtime2Time converts Xtime to time.Time. 将 Xtime 转换成 time.Time