Documentation
¶
Index ¶
- Constants
- func Verification(str, layout string) (resp time.Time, err error)
- type Pro
- func (p Pro) AfterDay(day int) Pro
- func (p Pro) AfterHour(hour int64) Pro
- func (p Pro) AfterMinute(seconds int64) Pro
- func (p Pro) AfterSeconds(seconds int64) Pro
- func (p Pro) BeforeDay(day int) Pro
- func (p Pro) BeforeHour(hour int64) Pro
- func (p Pro) BeforeMinute(seconds int64) Pro
- func (p Pro) BeforeSeconds(seconds int64) Pro
- func (p Pro) Between(start time.Time, end time.Time) bool
- func (p Pro) BetweenIncludedBoth(start time.Time, end time.Time) bool
- func (p Pro) BetweenIncludedEnd(start time.Time, end time.Time) bool
- func (p Pro) BetweenIncludedStart(start time.Time, end time.Time) bool
- func (p Pro) Bson() string
- func (p Pro) DiffInHour(t2 time.Time) (hour int64)
- func (p Pro) DiffInHourWithAbs(t2 time.Time) (hour int64)
- func (p Pro) DiffInMinutes(t2 time.Time) (hour int64)
- func (p Pro) DiffInMinutesWithAbs(t2 time.Time) (hour int64)
- func (p Pro) DiffInSecond(t2 time.Time) (hour int64)
- func (p Pro) DiffInSecondWithAbs(t2 time.Time) (hour int64)
- func (p Pro) EndOfCentury() Pro
- func (p Pro) EndOfDay() Pro
- func (p Pro) EndOfDecade() Pro
- func (p Pro) EndOfMonth() Pro
- func (p Pro) EndOfQuarter() Pro
- func (p Pro) EndOfYear() Pro
- func (p Pro) Eq(t2 time.Time) bool
- func (p Pro) Format() string
- func (p Pro) Gt(t2 time.Time) bool
- func (p Pro) Gte(t2 time.Time) bool
- func (p Pro) Lt(t2 time.Time) bool
- func (p Pro) Lte(t2 time.Time) bool
- func (p Pro) Month() int64
- func (p Pro) MonthOfYear() int64
- func (p Pro) Ne(t2 time.Time) bool
- func (p Pro) Now() time.Time
- func (p Pro) Quarter() (quarter int)
- func (p Pro) SetFormat(layout string) string
- func (p Pro) StartOfCentury() Pro
- func (p Pro) StartOfDay() Pro
- func (p Pro) StartOfDecade() Pro
- func (p Pro) StartOfMonth() Pro
- func (p Pro) StartOfQuarter() Pro
- func (p Pro) StartOfYear() Pro
- func (p Pro) Timestamp() int64
- func (p Pro) TimestampWithMicrosecond() int64
- func (p Pro) TimestampWithMillisecond() int64
- func (p Pro) TimestampWithNanosecond() int64
- func (p Pro) TimestampWithSecond() int64
- func (p Pro) ToDateFormat() string
- func (p Pro) ToTimeFormat() string
Constants ¶
View Source
const ( RFC3339Format = time.RFC3339 Iso8601Format = "2006-01-02T15:04:05-07:00" 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" 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" )
时间格式化常量
View Source
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微秒 )
数字常量
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pro ¶
Pro 结构体
func SetCurrentMillisecondUnix ¶ added in v1.0.193
SetCurrentMillisecondUnix 设置当前的时间 毫秒Unix时间戳
func SetCurrentUnix ¶ added in v1.0.30
SetCurrentUnix 设置当前的时间 Unix时间戳
func (Pro) AfterMinute ¶ added in v1.0.47
AfterMinute 获取n分钟后的时间
func (Pro) BeforeMinute ¶ added in v1.0.47
BeforeMinute 获取n分钟前的时间
func (Pro) BetweenIncludedBoth ¶ added in v1.0.47
BetweenIncludedBoth 是否在两个时间之间(包括这两个时间)
func (Pro) BetweenIncludedEnd ¶ added in v1.0.47
BetweenIncludedEnd 是否在两个时间之间(包括结束时间)
func (Pro) BetweenIncludedStart ¶ added in v1.0.47
BetweenIncludedStart 是否在两个时间之间(包括开始时间)
func (Pro) DiffInHourWithAbs ¶
DiffInHourWithAbs 相差多少小时(绝对值)
func (Pro) DiffInMinutes ¶
DiffInMinutes 相差多少分钟
func (Pro) DiffInMinutesWithAbs ¶
DiffInMinutesWithAbs 相差多少分钟(绝对值)
func (Pro) DiffInSecondWithAbs ¶
DiffInSecondWithAbs 相差多少秒(绝对值)
func (Pro) StartOfCentury ¶ added in v1.0.44
StartOfCentury 本世纪开始时间
func (Pro) StartOfQuarter ¶ added in v1.0.44
StartOfQuarter 本季度开始时间
func (Pro) TimestampWithMicrosecond ¶ added in v1.0.44
TimestampWithMicrosecond 今天微秒级时间戳
func (Pro) TimestampWithMillisecond ¶
TimestampWithMillisecond 今天毫秒级时间戳
func (Pro) TimestampWithNanosecond ¶ added in v1.0.44
TimestampWithNanosecond 今天纳秒级时间戳
func (Pro) TimestampWithSecond ¶ added in v1.0.44
TimestampWithSecond 今天此刻时间戳
Click to show internal directories.
Click to hide internal directories.