Documentation ¶
Index ¶
- Constants
- type Pro
- func (p Pro) AfterDay(day int) Pro
- func (p Pro) AfterHour(hour int) Pro
- func (p Pro) AfterSeconds(seconds int) Pro
- func (p Pro) BeforeDay(day int) Pro
- func (p Pro) BeforeHour(hour int) Pro
- func (p Pro) BeforeSeconds(seconds int) Pro
- 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) Format() string
- func (p Pro) Month() int
- func (p Pro) MonthOfYear() int
- 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 ¶
This section is empty.
Types ¶
type Pro ¶
Pro 结构体
func (Pro) DiffInHourWithAbs ¶
DiffInHourWithAbs 相差多少小时(绝对值)
func (Pro) DiffInMinutes ¶
DiffInMinutes 相差多少分钟
func (Pro) DiffInMinutesWithAbs ¶
DiffInMinutesWithAbs 相差多少分钟(绝对值)
func (Pro) DiffInSecondWithAbs ¶
DiffInSecondWithAbs 相差多少秒(绝对值)
func (Pro) TimestampWithMicrosecond ¶
TimestampWithMicrosecond 今天微秒级时间戳
func (Pro) TimestampWithMillisecond ¶
TimestampWithMillisecond 今天毫秒级时间戳
func (Pro) TimestampWithNanosecond ¶
TimestampWithNanosecond 今天纳秒级时间戳
func (Pro) TimestampWithSecond ¶
TimestampWithSecond 今天此刻时间戳
Click to show internal directories.
Click to hide internal directories.