Documentation
¶
Index ¶
- Constants
- Variables
- func NowDateString(timezone ...string) string
- func NowDatetimeString(timezone ...string) string
- func NowTimeString(timezone ...string) string
- func NowTimestamp(timezone ...string) int64
- func SetTimezone(timezone string)
- func StdTimeToTimestamp(t time.Time, timezone ...string) int64
- func StringToStdTime(date string, format ...string) time.Time
- func StringToTimestamp(date string, format ...string) int64
- func TimestampToStdTime(timestamp int64, timezone ...string) time.Time
- type Date
- type DateTime
- type Datebin
- func FromDate(year, month, day int, timezone ...string) Datebin
- func FromDatetime(year, month, day, hour, minute, second int, timezone ...string) Datebin
- func FromDatetimeWithMicrosecond(year, month, day, hour, minute, second, microsecond int, timezone ...string) Datebin
- func FromDatetimeWithMillisecond(year, month, day, hour, minute, second, millisecond int, timezone ...string) Datebin
- func FromDatetimeWithNanosecond(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Datebin
- func FromStdTime(t time.Time, timezone ...string) Datebin
- func FromStdUnix(second int64, nsec int64, timezone ...string) Datebin
- func FromTime(hour, minute, second int, timezone ...string) Datebin
- func FromTimestamp(timestamp int64, timezone ...string) Datebin
- func New() Datebin
- func NewDatebin() Datebin
- func Now(timezone ...string) Datebin
- func Parse(date string, timezone ...string) Datebin
- func ParseDatetimeString(date string, format ...string) Datebin
- func ParseWithFormat(date string, format string, timezone ...string) Datebin
- func ParseWithLayout(date string, layout string, timezone ...string) Datebin
- func Today(timezone ...string) Datebin
- func Tomorrow(timezone ...string) Datebin
- func Yesterday(timezone ...string) Datebin
- func (this Datebin) AddBusinessDays(days int) Datebin
- func (this Datebin) AddCenturies(n uint) Datebin
- func (this Datebin) AddCenturiesNoOverflow(n uint) Datebin
- func (this Datebin) AddCentury() Datebin
- func (this Datebin) AddCenturyNoOverflow() Datebin
- func (this Datebin) AddDay() Datebin
- func (this Datebin) AddDays(n uint) Datebin
- func (this Datebin) AddDecade() Datebin
- func (this Datebin) AddDecadeNoOverflow() Datebin
- func (this Datebin) AddDecades(n uint) Datebin
- func (this Datebin) AddDecadesNoOverflow(n uint) Datebin
- func (this Datebin) AddDuration(duration string) Datebin
- func (this Datebin) AddHour() Datebin
- func (this Datebin) AddHours(n uint) Datebin
- func (this Datebin) AddMicrosecond() Datebin
- func (this Datebin) AddMicroseconds(n uint) Datebin
- func (this Datebin) AddMillisecond() Datebin
- func (this Datebin) AddMilliseconds(n uint) Datebin
- func (this Datebin) AddMinute() Datebin
- func (this Datebin) AddMinutes(n uint) Datebin
- func (this Datebin) AddMonth() Datebin
- func (this Datebin) AddMonthNoOverflow() Datebin
- func (this Datebin) AddMonths(n uint) Datebin
- func (this Datebin) AddMonthsNoOverflow(months uint) Datebin
- func (this Datebin) AddNanosecond() Datebin
- func (this Datebin) AddNanoseconds(n uint) Datebin
- func (this Datebin) AddQuarter() Datebin
- func (this Datebin) AddQuarterNoOverflow() Datebin
- func (this Datebin) AddQuarters(n uint) Datebin
- func (this Datebin) AddQuartersNoOverflow(n uint) Datebin
- func (this Datebin) AddSecond() Datebin
- func (this Datebin) AddSeconds(n uint) Datebin
- func (this Datebin) AddWeekday() Datebin
- func (this Datebin) AddWeekdays(n uint) Datebin
- func (this Datebin) AddYear() Datebin
- func (this Datebin) AddYearNoOverflow() Datebin
- func (this Datebin) AddYears(n uint) Datebin
- func (this Datebin) AddYearsNoOverflow(years uint) Datebin
- func (this Datebin) Age() int
- func (this Datebin) AppendError(err ...error) Datebin
- func (this Datebin) Average(d Datebin) Datebin
- func (this Datebin) Avg(d Datebin) Datebin
- func (this Datebin) Between(start Datebin, end Datebin) bool
- func (this Datebin) BetweenIncludEnd(start Datebin, end Datebin) bool
- func (this Datebin) BetweenIncludStart(start Datebin, end Datebin) bool
- func (this Datebin) BetweenIncluded(start Datebin, end Datebin) bool
- func (this Datebin) Century() int
- func (this Datebin) CenturyEnd() Datebin
- func (this Datebin) CenturyStart() Datebin
- func (this Datebin) Closest(a Datebin, b Datebin) Datebin
- func (this Datebin) Date() (year, month, day int)
- func (this Datebin) Datetime() (year, month, day, hour, minute, second int)
- func (this Datebin) DatetimeWithMicrosecond() (year, month, day, hour, minute, second, microsecond int)
- func (this Datebin) DatetimeWithMillisecond() (year, month, day, hour, minute, second, millisecond int)
- func (this Datebin) DatetimeWithNanosecond() (year, month, day, hour, minute, second, nanosecond int)
- func (this Datebin) Day() int
- func (this Datebin) DayEnd() Datebin
- func (this Datebin) DayOfMonth() int
- func (this Datebin) DayOfWeek() int
- func (this Datebin) DayOfWeekDates(day time.Weekday) []Datebin
- func (this Datebin) DayOfYear() int
- func (this Datebin) DayStart() Datebin
- func (this Datebin) DaysInMonth() int
- func (this Datebin) Decade() int
- func (this Datebin) DecadeEnd() Datebin
- func (this Datebin) DecadeStart() Datebin
- func (this Datebin) Diff(date Datebin) DiffTime
- func (this Datebin) Eq(d Datebin) bool
- func (this Datebin) Error() error
- func (this Datebin) Farthest(a Datebin, b Datebin) Datebin
- func (this Datebin) FixedZone(name string, offset int) Datebin
- func (this Datebin) Format(layout string, timezone ...string) string
- func (this Datebin) FromDate(year, month, day int, timezone ...string) Datebin
- func (this Datebin) FromDatetime(year, month, day, hour, minute, second int, timezone ...string) Datebin
- func (this Datebin) FromDatetimeWithMicrosecond(year, month, day, hour, minute, second, microsecond int, timezone ...string) Datebin
- func (this Datebin) FromDatetimeWithMillisecond(year, month, day, hour, minute, second, millisecond int, timezone ...string) Datebin
- func (this Datebin) FromDatetimeWithNanosecond(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Datebin
- func (this Datebin) FromStdTime(t time.Time, timezone ...string) Datebin
- func (this Datebin) FromStdUnix(second int64, nsec int64, timezone ...string) Datebin
- func (this Datebin) FromTime(hour, minute, second int, timezone ...string) Datebin
- func (this Datebin) FromTimestamp(timestamp int64, timezone ...string) Datebin
- func (this Datebin) GetErrors() []error
- func (this Datebin) GetLocation() *time.Location
- func (this Datebin) GetLocationString() string
- func (this Datebin) GetOffset() int
- func (this Datebin) GetTime() time.Time
- func (this Datebin) GetTimezone() string
- func (this Datebin) GetWeekStartAt() time.Weekday
- func (this Datebin) GetZone() (string, int)
- func (this Datebin) GoString() string
- func (this *Datebin) GobDecode(data []byte) error
- func (this Datebin) GobEncode() ([]byte, error)
- func (this Datebin) Gt(d Datebin) bool
- func (this Datebin) Gte(d Datebin) bool
- func (this Datebin) Hour() int
- func (this Datebin) HourEnd() Datebin
- func (this Datebin) HourStart() Datebin
- func (this Datebin) ISOWeek() int
- func (this Datebin) ISOYear() int
- func (this Datebin) IsAM() bool
- func (this Datebin) IsApril() bool
- func (this Datebin) IsAquariusStar() bool
- func (this Datebin) IsAriesStar() bool
- func (this Datebin) IsAugust() bool
- func (this Datebin) IsAutumn() bool
- func (this Datebin) IsCancerStar() bool
- func (this Datebin) IsCapricornStar() bool
- func (this Datebin) IsCurrentMonth() bool
- func (this Datebin) IsCurrentYear() bool
- func (this Datebin) IsDST() bool
- func (this Datebin) IsDecember() bool
- func (this Datebin) IsEndOfDay() bool
- func (this Datebin) IsEndOfDayWithMicrosecond() bool
- func (this Datebin) IsFebruary() bool
- func (this Datebin) IsFriday() bool
- func (this Datebin) IsFuture() bool
- func (this Datebin) IsGeminiStar() bool
- func (this Datebin) IsInvalid() bool
- func (this Datebin) IsJanuary() bool
- func (this Datebin) IsJuly() bool
- func (this Datebin) IsJune() bool
- func (this Datebin) IsLastOfMonth() bool
- func (this Datebin) IsLatelyMonth() bool
- func (this Datebin) IsLatelyWeek() bool
- func (this Datebin) IsLeapYear() bool
- func (this Datebin) IsLeoStar() bool
- func (this Datebin) IsLibraStar() bool
- func (this Datebin) IsLocal() bool
- func (this Datebin) IsLongYear() bool
- func (this Datebin) IsMarch() bool
- func (this Datebin) IsMay() bool
- func (this Datebin) IsMidday(midDay ...string) bool
- func (this Datebin) IsMidnight() bool
- func (this Datebin) IsMonday() bool
- func (this Datebin) IsNovember() bool
- func (this Datebin) IsNow() bool
- func (this Datebin) IsOctober() bool
- func (this Datebin) IsPM() bool
- func (this Datebin) IsPast() bool
- func (this Datebin) IsPiscesStar() bool
- func (this Datebin) IsSagittariusStar() bool
- func (this Datebin) IsSameAs(format string, date Datebin) bool
- func (this Datebin) IsSameAsWithLayout(layout string, date Datebin) bool
- func (this Datebin) IsSameBirthday(date Datebin) bool
- func (this Datebin) IsSameDay(date Datebin) bool
- func (this Datebin) IsSameHour(date Datebin) bool
- func (this Datebin) IsSameMinute(date Datebin) bool
- func (this Datebin) IsSameMonth(date Datebin) bool
- func (this Datebin) IsSameMonthDay(date Datebin) bool
- func (this Datebin) IsSameSecond(date Datebin) bool
- func (this Datebin) IsSameUnit(unit string, date Datebin) bool
- func (this Datebin) IsSameYear(date Datebin) bool
- func (this Datebin) IsSameYearMonth(date Datebin) bool
- func (this Datebin) IsSameYearMonthDay(date Datebin) bool
- func (this Datebin) IsSaturday() bool
- func (this Datebin) IsScorpioStar() bool
- func (this Datebin) IsSeptember() bool
- func (this Datebin) IsSpring() bool
- func (this Datebin) IsStartOfDay() bool
- func (this Datebin) IsStartOfDayWithMicrosecond() bool
- func (this Datebin) IsSummer() bool
- func (this Datebin) IsSunday() bool
- func (this Datebin) IsTaurusStar() bool
- func (this Datebin) IsThursday() bool
- func (this Datebin) IsToday() bool
- func (this Datebin) IsTomorrow() bool
- func (this Datebin) IsTuesday() bool
- func (this Datebin) IsUTC() bool
- func (this Datebin) IsVirgoStar() bool
- func (this Datebin) IsWednesday() bool
- func (this Datebin) IsWeekday() bool
- func (this Datebin) IsWeekend() bool
- func (this Datebin) IsWinter() bool
- func (this Datebin) IsYesterday() bool
- func (this Datebin) IsZero() bool
- func (this Datebin) Layout(layout string, timezone ...string) string
- func (this Datebin) Local() Datebin
- func (this Datebin) Lt(d Datebin) bool
- func (this Datebin) Lte(d Datebin) bool
- func (this Datebin) MarshalBinary() ([]byte, error)
- func (this Datebin) MarshalJSON() ([]byte, error)
- func (this Datebin) Max(d Datebin) Datebin
- func (this Datebin) Maximum(d Datebin) Datebin
- func (this Datebin) Microsecond() int
- func (this Datebin) Millisecond() int
- func (this Datebin) Min(d Datebin) Datebin
- func (this Datebin) Minimum(d Datebin) Datebin
- func (this Datebin) Minute() int
- func (this Datebin) MinuteEnd() Datebin
- func (this Datebin) MinuteStart() Datebin
- func (this Datebin) Month() int
- func (this Datebin) MonthEnd() Datebin
- func (this Datebin) MonthOfYear() int
- func (this Datebin) MonthStart() Datebin
- func (this Datebin) NYearEnd(year int) Datebin
- func (this Datebin) NYearStart(year int) Datebin
- func (this Datebin) Nanosecond() int
- func (this Datebin) Ne(d Datebin) bool
- func (this Datebin) Now(timezone ...string) Datebin
- func (this Datebin) Offset(field string, offset int, timezone ...string) Datebin
- func (this Datebin) OffsetMonthsNoOverflow(months int) Datebin
- func (this Datebin) OffsetYearsNoOverflow(years int) Datebin
- func (this Datebin) OnError(fn ErrorFunc) Datebin
- func (this Datebin) Parse(date string, timezone ...string) Datebin
- func (this Datebin) ParseWithFormat(date string, format string, timezone ...string) Datebin
- func (this Datebin) ParseWithLayout(date string, layout string, timezone ...string) Datebin
- func (this Datebin) Quarter() (quarter int)
- func (this Datebin) Round(d time.Duration) Datebin
- func (this *Datebin) Scan(value any) error
- func (this Datebin) SeasonEnd() Datebin
- func (this Datebin) SeasonStart() Datebin
- func (this Datebin) Second() int
- func (this Datebin) SecondEnd() Datebin
- func (this Datebin) SecondStart() Datebin
- func (this Datebin) SetDate(year, month, day int) Datebin
- func (this Datebin) SetDatetime(year, month, day, hour, minute, second int) Datebin
- func (this Datebin) SetDatetimeWithMicrosecond(year, month, day, hour, minute, second, microsecond int) Datebin
- func (this Datebin) SetDatetimeWithMillisecond(year, month, day, hour, minute, second, millisecond int) Datebin
- func (this Datebin) SetDatetimeWithNanosecond(year, month, day, hour, minute, second, nanosecond int) Datebin
- func (this Datebin) SetDay(day int) Datebin
- func (this Datebin) SetHour(hour int) Datebin
- func (this Datebin) SetMicrosecond(microsecond int) Datebin
- func (this Datebin) SetMillisecond(millisecond int) Datebin
- func (this Datebin) SetMinute(minute int) Datebin
- func (this Datebin) SetMonth(month int) Datebin
- func (this Datebin) SetNanosecond(nanosecond int) Datebin
- func (this Datebin) SetSecond(second int) Datebin
- func (this Datebin) SetTime(hour, minute, second int) Datebin
- func (this Datebin) SetTimezone(timezone string) Datebin
- func (this Datebin) SetWeekStartsAt(day string) Datebin
- func (this Datebin) SetYear(year int) Datebin
- func (this Datebin) StartAndEndOfWeeksOfMonth() []weekRange
- func (this Datebin) String() string
- func (this Datebin) SubCenturies(n uint) Datebin
- func (this Datebin) SubCenturiesNoOverflow(n uint) Datebin
- func (this Datebin) SubCentury() Datebin
- func (this Datebin) SubCenturyNoOverflow() Datebin
- func (this Datebin) SubDay() Datebin
- func (this Datebin) SubDays(n uint) Datebin
- func (this Datebin) SubDecade() Datebin
- func (this Datebin) SubDecadeNoOverflow() Datebin
- func (this Datebin) SubDecades(n uint) Datebin
- func (this Datebin) SubDecadesNoOverflow(n uint) Datebin
- func (this Datebin) SubDuration(duration string) Datebin
- func (this Datebin) SubHour() Datebin
- func (this Datebin) SubHours(n uint) Datebin
- func (this Datebin) SubMicrosecond() Datebin
- func (this Datebin) SubMicroseconds(n uint) Datebin
- func (this Datebin) SubMillisecond() Datebin
- func (this Datebin) SubMilliseconds(n uint) Datebin
- func (this Datebin) SubMinute() Datebin
- func (this Datebin) SubMinutes(n uint) Datebin
- func (this Datebin) SubMonth() Datebin
- func (this Datebin) SubMonthNoOverflow() Datebin
- func (this Datebin) SubMonths(n uint) Datebin
- func (this Datebin) SubMonthsNoOverflow(n uint) Datebin
- func (this Datebin) SubNanosecond() Datebin
- func (this Datebin) SubNanoseconds(n uint) Datebin
- func (this Datebin) SubQuarter() Datebin
- func (this Datebin) SubQuarterNoOverflow() Datebin
- func (this Datebin) SubQuarters(n uint) Datebin
- func (this Datebin) SubQuartersNoOverflow(n uint) Datebin
- func (this Datebin) SubSecond() Datebin
- func (this Datebin) SubSeconds(n uint) Datebin
- func (this Datebin) SubWeekday() Datebin
- func (this Datebin) SubWeekdays(n uint) Datebin
- func (this Datebin) SubYear() Datebin
- func (this Datebin) SubYearNoOverflow() Datebin
- func (this Datebin) SubYears(n uint) Datebin
- func (this Datebin) SubYearsNoOverflow(n uint) Datebin
- func (this Datebin) Time() (hour, minute, second int)
- func (this Datebin) Timestamp() int64
- func (this Datebin) TimestampWithMicrosecond() int64
- func (this Datebin) TimestampWithMillisecond() int64
- func (this Datebin) TimestampWithNanosecond() int64
- func (this Datebin) TimestampWithSecond() int64
- func (this Datebin) ToAnsicString(timezone ...string) string
- func (this Datebin) ToAtomString(timezone ...string) string
- func (this Datebin) ToCookieString(timezone ...string) string
- func (this Datebin) ToDateString(timezone ...string) string
- func (this Datebin) ToDatetimeMicroString(timezone ...string) string
- func (this Datebin) ToDatetimeMilliString(timezone ...string) string
- func (this Datebin) ToDatetimeNanoString(timezone ...string) string
- func (this Datebin) ToDatetimeString(timezone ...string) string
- func (this Datebin) ToDayDateTimeString(timezone ...string) string
- func (this Datebin) ToFormatString(layout string, timezone ...string) string
- func (this Datebin) ToFormattedDateString(timezone ...string) string
- func (this Datebin) ToFormattedDayDateString(timezone ...string) string
- func (this Datebin) ToHourMinuteString(timezone ...string) string
- func (this Datebin) ToHourString(timezone ...string) string
- func (this Datebin) ToISO8601MicroString(timezone ...string) string
- func (this Datebin) ToISO8601MilliString(timezone ...string) string
- func (this Datebin) ToISO8601NanoString(timezone ...string) string
- func (this Datebin) ToISO8601String(timezone ...string) string
- func (this Datebin) ToISO8601ZuluMicroString(timezone ...string) string
- func (this Datebin) ToISO8601ZuluMilliString(timezone ...string) string
- func (this Datebin) ToISO8601ZuluNanoString(timezone ...string) string
- func (this Datebin) ToISO8601ZuluString(timezone ...string) string
- func (this Datebin) ToKitchenString(timezone ...string) string
- func (this Datebin) ToLayoutString(layout string, timezone ...string) string
- func (this Datebin) ToRFC1036String(timezone ...string) string
- func (this Datebin) ToRFC1123String(timezone ...string) string
- func (this Datebin) ToRFC1123ZString(timezone ...string) string
- func (this Datebin) ToRFC2822String(timezone ...string) string
- func (this Datebin) ToRFC3339MicroString(timezone ...string) string
- func (this Datebin) ToRFC3339MilliString(timezone ...string) string
- func (this Datebin) ToRFC3339NanoString(timezone ...string) string
- func (this Datebin) ToRFC3339String(timezone ...string) string
- func (this Datebin) ToRFC7231String(timezone ...string) string
- func (this Datebin) ToRFC822String(timezone ...string) string
- func (this Datebin) ToRFC822ZString(timezone ...string) string
- func (this Datebin) ToRFC850String(timezone ...string) string
- func (this Datebin) ToRssString(timezone ...string) string
- func (this Datebin) ToRubyDateString(timezone ...string) string
- func (this Datebin) ToSeasonString(timezone ...string) string
- func (this Datebin) ToShortDateString(timezone ...string) string
- func (this Datebin) ToShortDatetimeMicroString(timezone ...string) string
- func (this Datebin) ToShortDatetimeMilliString(timezone ...string) string
- func (this Datebin) ToShortDatetimeNanoString(timezone ...string) string
- func (this Datebin) ToShortDatetimeString(timezone ...string) string
- func (this Datebin) ToShortHourMinuteString(timezone ...string) string
- func (this Datebin) ToShortTimeString(timezone ...string) string
- func (this Datebin) ToStampMicroString(timezone ...string) string
- func (this Datebin) ToStampMilliString(timezone ...string) string
- func (this Datebin) ToStampNanoString(timezone ...string) string
- func (this Datebin) ToStampString(timezone ...string) string
- func (this Datebin) ToStarString(timezone ...string) string
- func (this Datebin) ToStdTime(timezone ...string) time.Time
- func (this Datebin) ToString(timezone ...string) string
- func (this Datebin) ToTimeString(timezone ...string) string
- func (this Datebin) ToUnixDateString(timezone ...string) string
- func (this Datebin) ToW3CString(timezone ...string) string
- func (this Datebin) ToWeekdayString(timezone ...string) string
- func (this Datebin) Today(timezone ...string) Datebin
- func (this Datebin) Tomorrow(timezone ...string) Datebin
- func (this Datebin) Truncate(d time.Duration) Datebin
- func (this Datebin) UTC() Datebin
- func (this *Datebin) UnmarshalBinary(data []byte) error
- func (this *Datebin) UnmarshalJSON(val []byte) error
- func (this Datebin) Value() (driver.Value, error)
- func (this Datebin) WeekEnd() Datebin
- func (this Datebin) WeekOfYear() int
- func (this Datebin) WeekStart() Datebin
- func (this Datebin) Weekday() int
- func (this Datebin) WithErrors(errs []error) Datebin
- func (this Datebin) WithLocation(loc *time.Location) Datebin
- func (this Datebin) WithTime(time time.Time) Datebin
- func (this Datebin) WithWeekStartAt(weekday time.Weekday) Datebin
- func (this Datebin) Year() int
- func (this Datebin) YearEnd() Datebin
- func (this Datebin) YearStart() Datebin
- func (this Datebin) Yesterday(timezone ...string) Datebin
- type DiffTime
- func (this DiffTime) Days() int64
- func (this DiffTime) DaysAbs() int64
- func (this DiffTime) DurationBetween() time.Duration
- func (this DiffTime) DurationBetweenAbs() time.Duration
- func (this DiffTime) DurationBetweens() (days, hours, minutes, seconds int)
- func (this DiffTime) DurationBetweensAbs() (days, hours, minutes, seconds int)
- func (this DiffTime) Format(str string) string
- func (this DiffTime) Formatter() Formatter
- func (this DiffTime) GetEnd() Datebin
- func (this DiffTime) GetStart() Datebin
- func (this DiffTime) Hours() int64
- func (this DiffTime) HoursAbs() int64
- func (this DiffTime) Minutes() int64
- func (this DiffTime) MinutesAbs() int64
- func (this DiffTime) Months() int64
- func (this DiffTime) MonthsAbs() int64
- func (this DiffTime) Seconds() int64
- func (this DiffTime) SecondsAbs() int64
- func (this DiffTime) SetEnd(end Datebin) DiffTime
- func (this DiffTime) SetStart(start Datebin) DiffTime
- func (this DiffTime) Weeks() int64
- func (this DiffTime) WeeksAbs() int64
- func (this DiffTime) Years() int64
- func (this DiffTime) YearsAbs() int64
- type ErrorFunc
- type Formatter
- func (this Formatter) Day() int
- func (this Formatter) FromDay(data int64) Formatter
- func (this Formatter) FromHour(data int64) Formatter
- func (this Formatter) FromMicrosecond(data int64) Formatter
- func (this Formatter) FromMillisecond(data int64) Formatter
- func (this Formatter) FromMinute(data int64) Formatter
- func (this Formatter) FromNanosecond(data int64) Formatter
- func (this Formatter) FromSecond(data int64) Formatter
- func (this Formatter) FromWeek(data int64) Formatter
- func (this Formatter) GetTime() int64
- func (this Formatter) Hour() int
- func (this Formatter) Microsecond() int
- func (this Formatter) Millisecond() int
- func (this Formatter) Minute() int
- func (this Formatter) Nanosecond() int
- func (this Formatter) Second() int
- func (this Formatter) WeekAndDay() (int, int)
- func (this Formatter) WithTime(data int64) Formatter
- type Timestamp
Constants ¶
const ( // 皮秒[ps] [Picosecond = Nanosecond * 0.001] Picosecond = time.Nanosecond / 1000 // 纳秒[ns] [Nanosecond time.Duration = 1] Nanosecond = time.Nanosecond // 微妙[µs] [Microsecond = Nanosecond * 1000] Microsecond = time.Microsecond // 毫秒[ms] [Millisecond = Microsecond * 1000] Millisecond = time.Millisecond // 秒[s] [Second = Millisecond * 1000] Second = time.Second // 分钟[m] [Minute = Second * 60] Minute = time.Minute // 小时[h] [Hour = Minute * 60] Hour = time.Hour // 天[d] [Day = Hour * 24] Day = time.Hour * 24 // 周[w] [Week = Day * 7] Week = Day * 7 )
时间常量 time const
const ( Local = "Local" CET = "CET" EET = "EET" EST = "EST" GMT = "GMT" UTC = "UTC" CTT = "CTT" 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" // 土耳其 Majuro = "Pacific/Majuro" // 马朱罗 Midway = "Pacific/Midway" // 中途岛 Honolulu = "Pacific/Honolulu" // 檀香山 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" // 泰国-曼谷 HoChiMinh = "Asia/Ho_Chi_Minh" // 越南 Pyongyang = "Asia/Pyongyang" // 韩国 Dubai = "Asia/Dubai" // 迪拜 NewYork = "America/New_York" // 纽约 LosAngeles = "America/Los_Angeles" // 洛杉矶 Chicago = "America/Chicago" // 芝加哥 Santiago = "America/Santiago" // 圣地亚哥 SaoPaulo = "America/Sao_Paulo" // 圣保罗 Moscow = "Europe/Moscow" // 莫斯科 London = "Europe/London" // 欧洲-伦敦 Berlin = "Europe/Berlin" // 柏林 Paris = "Europe/Paris" // 巴黎 Rome = "Europe/Rome" // 罗马 Athens = "Europe/Athens" // 东欧标准时间 (雅典) Helsinki = "Europe/Helsinki" // 东欧标准时间 (赫尔辛基) Minsk = "Europe/Minsk" // 明斯克 Amsterdam = "Europe/Amsterdam" // 中欧标准时间 (阿姆斯特丹) )
时区常量 timezones const
const ( Monday = "Monday" Tuesday = "Tuesday" Wednesday = "Wednesday" Thursday = "Thursday" Friday = "Friday" Saturday = "Saturday" Sunday = "Sunday" )
周常量 week const
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 const
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微秒 )
数字常量 types const
const ( AnsicFormat = time.ANSIC UnixDateFormat = time.UnixDate RubyDateFormat = time.RubyDate KitchenFormat = time.Kitchen RFC822Format = time.RFC822 RFC822ZFormat = time.RFC822Z RFC850Format = time.RFC850 RFC1123Format = time.RFC1123 RFC1123ZFormat = time.RFC1123Z RssFormat = time.RFC1123Z RFC2822Format = time.RFC1123Z RFC3339Format = time.RFC3339 RFC3339MilliFormat = "2006-01-02T15:04:05.999Z07:00" RFC3339MicroFormat = "2006-01-02T15:04:05.999999Z07:00" RFC3339NanoFormat = "2006-01-02T15:04:05.999999999Z07:00" W3CFormat = RFC3339Format AtomFormat = RFC3339Format StampFormat = time.Stamp StampMilliFormat = time.StampMilli StampMicroFormat = time.StampMicro StampNanoFormat = time.StampNano CookieFormat = "Monday, 02-Jan-2006 15:04:05 MST" RFC1036Format = "Mon, 02 Jan 06 15:04:05 -0700" RFC7231Format = "Mon, 02 Jan 2006 15:04:05 GMT" ISO8601Format = "2006-01-02T15:04:05-07:00" ISO8601MilliFormat = "2006-01-02T15:04:05.999-07:00" ISO8601MicroFormat = "2006-01-02T15:04:05.999999-07:00" ISO8601NanoFormat = "2006-01-02T15:04:05.999999999-07:00" ISO8601ZuluFormat = "2006-01-02T15:04:05Z" ISO8601ZuluMilliFormat = "2006-01-02T15:04:05.999Z" ISO8601ZuluMicroFormat = "2006-01-02T15:04:05.999999Z" ISO8601ZuluNanoFormat = "2006-01-02T15:04:05.999999999Z" DayDateTimeFormat = "Mon, Jan 2, 2006 3:04 PM" FormattedDateFormat = "Jan 2, 2006" FormattedDayDateFormat = "Mon, Jan 2, 2006" DatetimeNanoFormat = "2006-01-02 15:04:05.999999999" DatetimeMicroFormat = "2006-01-02 15:04:05.999999" DatetimeMilliFormat = "2006-01-02 15:04:05.999" DatetimeFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" TimeFormat = "15:04:05" HourMinuteFormat = "15:04" HourFormat = "15" ShortDatetimeNanoFormat = "20060102150405.999999999" ShortDatetimeMicroFormat = "20060102150405.999999" ShortDatetimeMilliFormat = "20060102150405.999" ShortDatetimeFormat = "20060102150405" ShortDateFormat = "20060102" ShortTimeFormat = "150405" ShortHourMinuteFormat = "1504" )
时间格式化常量 formats const
Variables ¶
var ( // 解析的格式字符 // parse format list PaseFormats = map[string]string{ "D": "Mon", "d": "02", "N": "Monday", "j": "2", "l": "Monday", "z": "__2", "F": "January", "m": "01", "M": "Jan", "n": "1", "Y": "2006", "y": "06", "a": "pm", "A": "PM", "g": "3", "G": "=G=15", "h": "03", "H": "15", "i": "04", "s": "05", "u": "000000", "O": "-0700", "P": "-07:00", "T": "MST", "c": "2006-01-02T15:04:05Z07:00", "r": "Mon, 02 Jan 2006 15:04:05 -0700", } // 输出的格式字符 // output format list ToFormats = map[string]string{ "D": "Mon", "d": "02", "j": "2", "l": "Monday", "F": "January", "m": "01", "M": "Jan", "n": "1", "Y": "2006", "y": "06", "a": "pm", "A": "PM", "g": "3", "h": "03", "H": "15", "i": "04", "s": "05", "O": "-0700", "P": "-07:00", "T": "MST", "c": "2006-01-02T15:04:05Z07:00", "r": "Mon, 02 Jan 2006 15:04:05 -0700", } // 月份 // Month list Months = map[int]time.Month{ 1: time.January, 2: time.February, 3: time.March, 4: time.April, 5: time.May, 6: time.June, 7: time.July, 8: time.August, 9: time.September, 10: time.October, 11: time.November, 12: time.December, } // 周列表 // Weekday list Weekdays = []string{ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", } )
Functions ¶
func NowDatetimeString ¶
当前日期时间字符 get now time Datetime string
func NowTimestamp ¶ added in v1.0.1021
当前时间戳 get now time Timestamp
func StdTimeToTimestamp ¶ added in v1.0.1021
标准时间转换为时间戳 std time to timestamp
func StringToStdTime ¶ added in v1.0.1021
时间字符转为标准时间 date string to std time
func StringToTimestamp ¶
时间字符转为时间戳 date string to timestamp
Types ¶
type Date ¶
type Date Datebin
日期 Date struct
func (Date) MarshalJSON ¶ added in v1.0.1006
转换为 json Marshal to JSON
func (*Date) UnmarshalJSON ¶ added in v1.0.1006
解析 json Unmarshal JSON data
type DateTime ¶ added in v1.0.1006
type DateTime Datebin
日期时间 DateTime struct
func (DateTime) MarshalJSON ¶ added in v1.0.1006
转换为 json Marshal to JSON
func (*DateTime) UnmarshalJSON ¶ added in v1.0.1006
解析 json Unmarshal JSON data
type Datebin ¶
type Datebin struct { // 错误 / error list Errors []error // contains filtered or unexported fields }
*
- 日期 / Datebin *
- @create 2022-3-6
- @author deatil
func FromDatetime ¶ added in v1.0.1005
输入日期和时间 create from date_time
func FromDatetimeWithMicrosecond ¶ added in v1.0.1005
func FromDatetimeWithMicrosecond(year, month, day, hour, minute, second, microsecond int, timezone ...string) Datebin
输入日期时间带微秒 create from date_time with microsecond
func FromDatetimeWithMillisecond ¶ added in v1.0.1005
func FromDatetimeWithMillisecond(year, month, day, hour, minute, second, millisecond int, timezone ...string) Datebin
输入日期时间带毫秒 create from date_time with millisecond
func FromDatetimeWithNanosecond ¶ added in v1.0.1005
func FromDatetimeWithNanosecond(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Datebin
输入日期时间带纳秒 create from date_time with nanosecond
func FromStdTime ¶ added in v1.0.1017
输入标准时间 create from std time
func FromStdUnix ¶ added in v1.0.1017
输入标准时间戳带毫秒 create from std unix
func FromTimestamp ¶ added in v1.0.1005
输入时间戳 create from std timestamp
func ParseDatetimeString ¶ added in v1.0.1005
用格式化字符或者布局字符解析时间字符 Parse date string with format or layout
func ParseWithFormat ¶ added in v1.0.1002
用格式化字符解析时间字符 Parse date string with format
func ParseWithLayout ¶ added in v1.0.1002
用布局字符解析时间字符 Parse date string with layout
func (Datebin) AddBusinessDays ¶ added in v1.0.1021
将工作日添加到日期 add Business Days
func (Datebin) AddCenturies ¶
后 n 百年 add n Centuries
func (Datebin) AddCenturiesNoOverflow ¶
后 n 百年 add n Centuries noOverflow
func (Datebin) AddCenturyNoOverflow ¶
后一百年 add one Century noOverflow
func (Datebin) AddDecadeNoOverflow ¶
后十年 add one Decade noOverflow
func (Datebin) AddDecadesNoOverflow ¶
后 n 十年 Add n Decades noOverflow
func (Datebin) AddDuration ¶
按照持续时长字符串增加时间 add Duration time
func (Datebin) AddMicrosecond ¶
后一微妙 Add one Microsecond
func (Datebin) AddMicroseconds ¶
后 n 微妙 Add n Microseconds
func (Datebin) AddMillisecond ¶
后一毫秒 Add one Millisecond
func (Datebin) AddMilliseconds ¶
后 n 毫秒 Add n Milliseconds
func (Datebin) AddMonthNoOverflow ¶
后一月 Add one Month NoOverflow
func (Datebin) AddMonthsNoOverflow ¶
后 n 月 (月份不溢出) Add n Months NoOverflow
func (Datebin) AddNanoseconds ¶
后 n 纳秒 Add n Nanoseconds
func (Datebin) AddQuarterNoOverflow ¶
后一季度 Add one Quarter NoOverflow
func (Datebin) AddQuartersNoOverflow ¶
后 n 季度 Add n Quarters NoOverflow
func (Datebin) AddYearNoOverflow ¶
后一年 Add one Year NoOverflow
func (Datebin) AddYearsNoOverflow ¶
后 n 年 (月份不溢出) Add n Years NoOverflow
func (Datebin) AppendError ¶ added in v1.0.1013
添加错误 append error
func (Datebin) BetweenIncludEnd ¶
是否在两个时间之间(包括结束时间) if a BetweenIncludEnd start and end
func (Datebin) BetweenIncludStart ¶
是否在两个时间之间(包括开始时间) if a BetweenIncludStart start and end
func (Datebin) BetweenIncluded ¶
是否在两个时间之间(包括这两个时间) if a BetweenIncluded start and end
func (Datebin) CenturyStart ¶
当前百年开始 get the Century start
func (Datebin) Datetime ¶ added in v1.0.1002
返回年月日时分秒数据 get year, month, day, hour, minute, second data
func (Datebin) DatetimeWithMicrosecond ¶ added in v1.0.1003
func (this Datebin) DatetimeWithMicrosecond() (year, month, day, hour, minute, second, microsecond int)
返回年月日时分秒数据带微秒 get year, month, day, hour, minute, second, microsecond data
func (Datebin) DatetimeWithMillisecond ¶ added in v1.0.1003
func (this Datebin) DatetimeWithMillisecond() (year, month, day, hour, minute, second, millisecond int)
返回年月日时分秒数据带毫秒 get year, month, day, hour, minute, second, millisecond data
func (Datebin) DatetimeWithNanosecond ¶ added in v1.0.1003
func (this Datebin) DatetimeWithNanosecond() (year, month, day, hour, minute, second, nanosecond int)
返回年月日时分秒数据带纳秒 get year, month, day, hour, minute, second, nanosecond data
func (Datebin) DayOfWeekDates ¶ added in v1.0.1021
获取给定月份的星期几的日期 get DayOfWeek datas
func (Datebin) FixedZone ¶ added in v1.0.1021
FixedZone 设置时区 FixedZone returns a Location that always uses the given zone name and offset (seconds east of UTC).
func (Datebin) FromDatetime ¶ added in v1.0.1021
func (this Datebin) FromDatetime(year, month, day, hour, minute, second int, timezone ...string) Datebin
输入日期和时间 create from date_time
func (Datebin) FromDatetimeWithMicrosecond ¶ added in v1.0.1021
func (this Datebin) FromDatetimeWithMicrosecond(year, month, day, hour, minute, second, microsecond int, timezone ...string) Datebin
输入日期时间带微秒 create from date_time with microsecond
func (Datebin) FromDatetimeWithMillisecond ¶ added in v1.0.1021
func (this Datebin) FromDatetimeWithMillisecond(year, month, day, hour, minute, second, millisecond int, timezone ...string) Datebin
输入日期时间带毫秒 create from date_time with millisecond
func (Datebin) FromDatetimeWithNanosecond ¶ added in v1.0.1021
func (this Datebin) FromDatetimeWithNanosecond(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Datebin
输入日期时间带纳秒 create from date_time with nanosecond
func (Datebin) FromStdTime ¶ added in v1.0.1021
输入标准时间 create from std time
func (Datebin) FromStdUnix ¶ added in v1.0.1021
输入标准时间戳带毫秒 create from std unix
func (Datebin) FromTimestamp ¶ added in v1.0.1021
输入时间戳 create from std timestamp
func (Datebin) GetLocation ¶
获取时区 Get Location struct
func (Datebin) GetLocationString ¶
获取时区字符 Get Location String
func (Datebin) GetTimezone ¶
获取时区 Zone 名称 Get Timezone string
func (Datebin) GetWeekStartAt ¶
获取周开始时间 Get Start Week
func (Datebin) GoString ¶ added in v1.0.1021
GoString implements fmt.GoStringer and formats t to be printed in Go source code.
func (Datebin) IsAquariusStar ¶
水瓶座 if the time is Aquarius Star ?
func (Datebin) IsCancerStar ¶
巨蟹座 if the time is Cancer Star ?
func (Datebin) IsCapricornStar ¶
摩羯座 if the time is Capricorn Star ?
func (Datebin) IsCurrentMonth ¶
是否是当月 if the time is Current Month ?
func (Datebin) IsCurrentYear ¶
是否是当年 if the time is Current Year ?
func (Datebin) IsDST ¶ added in v1.0.1017
是否是夏令时 if the time is DST timezone ? IsDST reports whether the time in the configured location is in Daylight Savings Time.
func (Datebin) IsEndOfDay ¶
是否当天结束 if the time is day end time ?
func (Datebin) IsEndOfDayWithMicrosecond ¶
是否当天结束带微妙 if the time is end of day with microsecond ?
func (Datebin) IsGeminiStar ¶
双子座 if the time is Gemini Star ?
func (Datebin) IsLastOfMonth ¶
是否是当前月最后一天 if the time is Month's Last day ?
func (Datebin) IsLatelyMonth ¶
时间是否是当前最近的一个月 if the time is Lately Month ?
func (Datebin) IsLatelyWeek ¶
时间是否是当前最近的一周 if the time is LatelyWeek ?
func (Datebin) IsMidnight ¶
是否是半夜 if the time is midnight time ?
func (Datebin) IsPiscesStar ¶
双鱼座 if the time is Pisces Star ?
func (Datebin) IsSagittariusStar ¶
射手座 if the time is Sagittarius Star ?
func (Datebin) IsSameAsWithLayout ¶ added in v1.0.1009
通过布局字符比对是否相等 if a and b Is Same With Layout string ?
func (Datebin) IsSameBirthday ¶
是否是相同生日日期 if a and b Is Same Birthday ?
func (Datebin) IsSameHour ¶
是否同一小时 if a and b Is Same Hour ?
func (Datebin) IsSameMinute ¶
是否同一分钟 if a and b Is Same Minute ?
func (Datebin) IsSameMonth ¶
是否是同一个月 if a and b Is Same Month ?
func (Datebin) IsSameMonthDay ¶
是否是同一个月的同一天 if a and b Is Same Month and Day ?
func (Datebin) IsSameSecond ¶
是否同一秒 if a and b Is Same Second ?
func (Datebin) IsSameUnit ¶
通过预设格式字符比对是否相等 unit 预设有: year | week | day | hour | minute | second | micro | microsecond if a and b Is Same with Unit ? unit has: year | week | day | hour | minute | second | micro | microsecond
func (Datebin) IsSameYear ¶
是否同一年 if a and b Is Same Year ?
func (Datebin) IsSameYearMonth ¶
是否是同一年的同一个月 if a and b Is Same Year and Month ?
func (Datebin) IsSameYearMonthDay ¶
是否是同一年的同一个月的同一天 if a and b Is Same Year, Month and Day ?
func (Datebin) IsScorpioStar ¶
天蝎座 if the time is Scorpio Star ?
func (Datebin) IsSeptember ¶
是否是九月 if the time is September ?
func (Datebin) IsStartOfDay ¶
是否当天开始 if the time is start of day ?
func (Datebin) IsStartOfDayWithMicrosecond ¶
是否当天开始带微妙 if the time is start of day with microsecond ?
func (Datebin) IsTaurusStar ¶
金牛座 if the time is Taurus Star ?
func (Datebin) IsWednesday ¶
是否是周三 if the time is Wednesday ?
func (Datebin) IsYesterday ¶
是否是昨天 if the time is Yesterday ?
func (Datebin) MarshalBinary ¶ added in v1.0.1019
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (Datebin) MarshalJSON ¶ added in v1.0.1006
转换为 json Marshal to JSON
func (Datebin) Microsecond ¶
获取当前微秒数,范围[0, 999999] get Microsecond data, range [0, 999999]
func (Datebin) Millisecond ¶
获取当前毫秒数,范围[0, 999] get Millisecond data, range [0, 999]
func (Datebin) NYearStart ¶
当前n年开始 get n years start
func (Datebin) Nanosecond ¶
获取当前纳秒数,范围[0, 999999999] get Nanosecond data, range [0, 999999999]
func (Datebin) OffsetMonthsNoOverflow ¶
不溢出增加/减少 n 月 add or sub Month NoOverflow
func (Datebin) OffsetYearsNoOverflow ¶
不溢出增加/减少 n 年 add or sub year NoOverflow
func (Datebin) ParseWithFormat ¶ added in v1.0.1002
用格式化字符解析时间字符 Parse date string with format
func (Datebin) ParseWithLayout ¶ added in v1.0.1002
用布局字符解析时间字符 Parse date string with layout
func (Datebin) Round ¶
用于查找将规定的持续时间 'd' 舍入为 'm' 持续时间的最接近倍数的结果 Round returns the result of rounding t to the nearest multiple of d (since the zero time). The rounding behavior for halfway values is to round up. If d <= 0, Round returns t stripped of any monotonic clock reading but otherwise unchanged.
Round operates on the time as an absolute duration since the zero time; it does not operate on the presentation form of the time. Thus, Round(Hour) may return a time with a non-zero minute, depending on the time's Location.
func (Datebin) SetDatetime ¶ added in v1.0.1002
日期时间 Set Datetime
func (Datebin) SetDatetimeWithMicrosecond ¶ added in v1.0.1002
func (this Datebin) SetDatetimeWithMicrosecond(year, month, day, hour, minute, second, microsecond int) Datebin
日期时间带微秒 Set Datetime With Microsecond
func (Datebin) SetDatetimeWithMillisecond ¶ added in v1.0.1002
func (this Datebin) SetDatetimeWithMillisecond(year, month, day, hour, minute, second, millisecond int) Datebin
日期时间带毫秒 Set Datetime With Millisecond
func (Datebin) SetDatetimeWithNanosecond ¶ added in v1.0.1002
func (this Datebin) SetDatetimeWithNanosecond(year, month, day, hour, minute, second, nanosecond int) Datebin
日期时间带纳秒 Set Datetime With Nanosecond
func (Datebin) SetMicrosecond ¶
设置微秒 Set Microsecond
func (Datebin) SetMillisecond ¶
设置毫秒 Set Millisecond
func (Datebin) SetNanosecond ¶
设置纳秒 Set Nanosecond
func (Datebin) SetTimezone ¶ added in v1.0.1008
设置时区 Set Timezone
func (Datebin) SetWeekStartsAt ¶ added in v1.0.1002
设置一周的开始日期 set WeekStartsAt
func (Datebin) StartAndEndOfWeeksOfMonth ¶ added in v1.0.1021
func (this Datebin) StartAndEndOfWeeksOfMonth() []weekRange
获取给定月份每周的开始日和结束日 get month all weeks
func (Datebin) SubCenturies ¶
前 n 百年 sub n Centuries
func (Datebin) SubCenturiesNoOverflow ¶
前 n 百年 sub n Centuries noOverflow
func (Datebin) SubCenturyNoOverflow ¶
前一百年 sub one noOverflow
func (Datebin) SubDecadeNoOverflow ¶
前十年 Sub one Decade noOverflow
func (Datebin) SubDecadesNoOverflow ¶
前 n 十年 Sub n Decades noOverflow
func (Datebin) SubDuration ¶
按照持续时长字符串减少时间 sub Duration time
func (Datebin) SubMicrosecond ¶
前一微妙 Sub one Microsecond
func (Datebin) SubMicroseconds ¶
前 n 微妙 Sub n Microseconds
func (Datebin) SubMillisecond ¶
前一毫秒 Sub one Millisecond
func (Datebin) SubMilliseconds ¶
前 n 毫秒 Sub n Milliseconds
func (Datebin) SubMonthNoOverflow ¶
前一月 Sub one Month NoOverflow
func (Datebin) SubMonthsNoOverflow ¶
前 n 月 Sub n Months NoOverflow
func (Datebin) SubNanoseconds ¶
前 n 纳秒 Sub n Nanoseconds
func (Datebin) SubQuarterNoOverflow ¶
前一季度 Sub one Quarter NoOverflow
func (Datebin) SubQuartersNoOverflow ¶
前 n 季度 Sub n Quarters NoOverflow
func (Datebin) SubYearNoOverflow ¶
前一年 Sub one Year NoOverflow
func (Datebin) SubYearsNoOverflow ¶
前 n 年 Sub n Years NoOverflow
func (Datebin) TimestampWithMicrosecond ¶
微秒级时间戳,16位 get Timestamp With Microsecond data, 16 length
func (Datebin) TimestampWithMillisecond ¶
毫秒级时间戳,13位 get Timestamp With Millisecond data, 13 length
func (Datebin) TimestampWithNanosecond ¶
纳秒级时间戳,19位 get Timestamp With Nanosecond data, 19 length
func (Datebin) TimestampWithSecond ¶
秒级时间戳,10位 get Timestamp data, 10 length
func (Datebin) ToAnsicString ¶
输出 Ansic 格式字符串 output datetime with Ansic layout
func (Datebin) ToAtomString ¶
输出 ATOM 格式字符串 output datetime with ATOM layout
func (Datebin) ToCookieString ¶
输出 Cookie 格式字符串 output datetime with Cookie layout
func (Datebin) ToDateString ¶
输出日期 Date 格式字符串 output datetime with Date layout
func (Datebin) ToDatetimeMicroString ¶ added in v1.0.1023
输出 DatetimeMicro 格式字符串 output datetime with DatetimeMicro layout
func (Datebin) ToDatetimeMilliString ¶ added in v1.0.1023
输出 DatetimeMilli 格式字符串 output datetime with DatetimeMilli layout
func (Datebin) ToDatetimeNanoString ¶ added in v1.0.1023
输出 DatetimeNano 格式字符串 output datetime with DatetimeNano layout
func (Datebin) ToDatetimeString ¶
输出 Datetime 格式字符串 output datetime with Datetime layout
func (Datebin) ToDayDateTimeString ¶
输出 DayDateTime 格式字符串 output datetime with DayDateTime layout
func (Datebin) ToFormatString ¶
输出格式化字符的时间字符串 output datetime with sign
func (Datebin) ToFormattedDateString ¶
输出 FormattedDate 格式字符串 output datetime with FormattedDate layout
func (Datebin) ToFormattedDayDateString ¶ added in v1.0.1023
输出 FormattedDayDate 格式字符串 output datetime with FormattedDayDate layout
func (Datebin) ToHourMinuteString ¶ added in v1.0.1023
输出时间 HourMinute 格式字符串 output datetime with HourMinute layout
func (Datebin) ToHourString ¶ added in v1.0.1023
输出时间 Hour 格式字符串 output datetime with Hour layout
func (Datebin) ToISO8601MicroString ¶ added in v1.0.1023
输出 ISO8601Micro 格式字符串 output datetime with ISO8601Micro layout
func (Datebin) ToISO8601MilliString ¶ added in v1.0.1023
输出 ISO8601Milli 格式字符串 output datetime with ISO8601Milli layout
func (Datebin) ToISO8601NanoString ¶ added in v1.0.1023
输出 ISO8601Nano 格式字符串 output datetime with ISO8601Nano layout
func (Datebin) ToISO8601String ¶
输出 ISO8601 格式字符串 output datetime with ISO8601 layout
func (Datebin) ToISO8601ZuluMicroString ¶ added in v1.0.1023
输出 ISO8601ZuluMicro 格式字符串 output datetime with ISO8601ZuluMicro layout
func (Datebin) ToISO8601ZuluMilliString ¶ added in v1.0.1023
输出 ISO8601ZuluMilli 格式字符串 output datetime with ISO8601ZuluMilli layout
func (Datebin) ToISO8601ZuluNanoString ¶ added in v1.0.1023
输出 ISO8601ZuluNano 格式字符串 output datetime with ISO8601ZuluNano layout
func (Datebin) ToISO8601ZuluString ¶ added in v1.0.1023
输出 ISO8601Zulu 格式字符串 output datetime with ISO8601Zulu layout
func (Datebin) ToKitchenString ¶
输出 Kitchen 格式字符串 output datetime with Kitchen layout
func (Datebin) ToLayoutString ¶
使用布局字符输出时间格式 output datetime with layout
func (Datebin) ToRFC1036String ¶
输出 RFC1036 格式字符串 output datetime with RFC1036 layout
func (Datebin) ToRFC1123String ¶
输出 RFC1123 格式字符串 output datetime with RFC1123 layout
func (Datebin) ToRFC1123ZString ¶
输出 RFC1123Z 格式字符串 output datetime with RFC1123Z layout
func (Datebin) ToRFC2822String ¶
输出 RFC2822 格式字符串 output datetime with RFC2822 layout
func (Datebin) ToRFC3339MicroString ¶ added in v1.0.1023
输出 RFC3339Milli 格式字符串 output datetime with RFC3339Milli layout
func (Datebin) ToRFC3339MilliString ¶ added in v1.0.1023
输出 RFC3339Milli 格式字符串 output datetime with RFC3339Milli layout
func (Datebin) ToRFC3339NanoString ¶ added in v1.0.1023
输出 RFC3339Nano 格式字符串 output datetime with RFC3339Nano layout
func (Datebin) ToRFC3339String ¶
输出 RFC3339 格式字符串 output datetime with RFC3339 layout
func (Datebin) ToRFC7231String ¶
输出 RFC7231 格式字符串 output datetime with RFC7231 layout
func (Datebin) ToRFC822String ¶
输出 RFC822 格式字符串 output datetime with RFC822 layout
func (Datebin) ToRFC822ZString ¶
输出 RFC822Z 格式字符串 output datetime with RFC822Z layout
func (Datebin) ToRFC850String ¶
输出 RFC850 格式字符串 output datetime with RFC850 layout
func (Datebin) ToRssString ¶
输出 Rss 格式字符串 output datetime with Rss layout
func (Datebin) ToRubyDateString ¶
输出 RubyDate 格式字符串 output datetime with RubyDate layout
func (Datebin) ToSeasonString ¶
返回当前季节,以气象划分 output Season name
func (Datebin) ToShortDateString ¶
输出 ShortDate 格式字符串 output datetime with ShortDate layout
func (Datebin) ToShortDatetimeMicroString ¶ added in v1.0.1023
输出 ShortDatetimeMicro 格式字符串 output datetime with ShortDatetimeMicro layout
func (Datebin) ToShortDatetimeMilliString ¶ added in v1.0.1023
输出 ShortDatetimeMilli 格式字符串 output datetime with ShortDatetimeMilli layout
func (Datebin) ToShortDatetimeNanoString ¶ added in v1.0.1023
输出 ShortDatetimeNano 格式字符串 output datetime with ShortDatetimeNano layout
func (Datebin) ToShortDatetimeString ¶
输出 ShortDatetime 格式字符串 output datetime with ShortDatetime layout
func (Datebin) ToShortHourMinuteString ¶ added in v1.0.1023
输出 ShortHourMinute 格式字符串 output datetime with ShortHourMinute layout
func (Datebin) ToShortTimeString ¶
输出 ShortTime 格式字符串 output datetime with ShortTime layout
func (Datebin) ToStampMicroString ¶ added in v1.0.1023
输出 StampMicro 格式字符串 output datetime with StampMicro layout
func (Datebin) ToStampMilliString ¶ added in v1.0.1023
输出 StampMilli 格式字符串 output datetime with StampMilli layout
func (Datebin) ToStampNanoString ¶ added in v1.0.1023
输出 StampNano 格式字符串 output datetime with StampNano layout
func (Datebin) ToStampString ¶ added in v1.0.1023
输出 Stamp 格式字符串 output datetime with Stamp layout
func (Datebin) ToStarString ¶
返回星座名称 output Star name
func (Datebin) ToTimeString ¶
输出时间 Time 格式字符串 output datetime with Time layout
func (Datebin) ToUnixDateString ¶
输出 UnixDate 格式字符串 output datetime with UnixDate layout
func (Datebin) ToW3CString ¶ added in v1.0.1002
输出 W3C 格式字符串 output datetime with W3C layout
func (Datebin) ToWeekdayString ¶
周几 output Weekday name
func (Datebin) Truncate ¶
用于查找将规定的持续时间 'd' 朝零舍入到 'm' 持续时间的倍数的结果 Truncate returns the result of rounding d toward zero to a multiple of m. If m <= 0, Truncate returns d unchanged.
func (*Datebin) UnmarshalBinary ¶ added in v1.0.1019
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Datebin) UnmarshalJSON ¶ added in v1.0.1006
解析 json Unmarshal JSON data
func (Datebin) WithErrors ¶ added in v1.0.1019
覆盖错误信息 set Errors
func (Datebin) WithLocation ¶
设置时区 set Location struct
func (Datebin) WithWeekStartAt ¶
设置周开始时间 set Start Week
type DiffTime ¶ added in v1.0.1008
*
- 时间间隔 / diff time *
- @create 2022-3-9
- @author deatil
func NewDiffTime ¶ added in v1.0.1008
构造函数 new DiffTime
func (DiffTime) DurationBetween ¶ added in v1.0.1021
计算两个日期之间的持续时间 get Duration data
func (DiffTime) DurationBetweenAbs ¶ added in v1.0.1023
计算两个日期之间的持续时间,绝对值 get abs Duration data
func (DiffTime) DurationBetweens ¶ added in v1.0.1021
返回持续时间为人类可读的数据 return Duration datas
func (DiffTime) DurationBetweensAbs ¶ added in v1.0.1021
返回持续时间为人类可读的数据,绝对值 return abs Duration datas
func (DiffTime) MinutesAbs ¶ added in v1.0.1008
获取相差分钟,绝对值 get diff abs Minutes
func (DiffTime) SecondsAbs ¶ added in v1.0.1008
获取相差秒,绝对值 get diff abs Seconds
type Formatter ¶ added in v1.0.1011
type Formatter struct {
// contains filtered or unexported fields
}
*
- 格式化时间 / Formatter time *
- @create 2022-12-11
- @author deatil
func (Formatter) FromMicrosecond ¶ added in v1.0.1011
传入微秒 set Microsecond
func (Formatter) FromMillisecond ¶ added in v1.0.1011
传入毫秒 set Millisecond
func (Formatter) FromMinute ¶ added in v1.0.1011
传入分钟 set Minute
func (Formatter) FromNanosecond ¶ added in v1.0.1011
传入纳秒 set Nanosecond
func (Formatter) FromSecond ¶ added in v1.0.1011
传入秒 set Second
func (Formatter) Microsecond ¶ added in v1.0.1011
获取微秒 get Microsecond
func (Formatter) Millisecond ¶ added in v1.0.1011
获取毫秒 get Millisecond
func (Formatter) Nanosecond ¶ added in v1.0.1011
获取纳秒 get Nanosecond
func (Formatter) WeekAndDay ¶ added in v1.0.1011
获取周数和天数 get Week And Day
type Timestamp ¶
type Timestamp Datebin
时间戳 Timestamp struct
func (Timestamp) MarshalJSON ¶ added in v1.0.1006
转换为 json Marshal to JSON
func (*Timestamp) UnmarshalJSON ¶ added in v1.0.1006
解析 json Unmarshal JSON data