Documentation ¶
Index ¶
- Constants
- Variables
- func AddDays(times t0.Time, days int) t0.Time
- func AddHour(times t0.Time, plusOrMinus string, seconds string) t0.Time
- func AddMinutes(times t0.Time, plusOrMinus string, minutes string) t0.Time
- func AddMonths(times t0.Time, month int) t0.Time
- func AddSeconds(times t0.Time, plusOrMinus string, hours string) t0.Time
- func AddYears(times t0.Time, year int) t0.Time
- func CurrentMinuteOfDay() int
- func CurrentSecondOfDay() int
- func DaySpan(now, then t0.Time) float64
- func DaysBetween(now, then t0.Time) int
- func HourSpan(now, then t0.Time) float64
- func HoursBetween(now, then t0.Time) int
- func IsLeapYear(year int) bool
- func IsTimeEmpty(time t0.Time) bool
- func MilliSecondSpan(now, then t0.Time) int64
- func MilliSecondsBetween(now, then t0.Time) int64
- func MinuteOfDay(t t0.Time) int
- func MinuteSpan(now, then t0.Time) float64
- func MinutesBetween(now, then t0.Time) int
- func MinutesToTime(minutes int) (hour int, minute int)
- func MonthSpan(now, then t0.Time) float64
- func MonthsBetween(now, then t0.Time) int
- func Now() t0.Time
- func NumToTimeDuration(num int, duration t0.Duration) t0.Duration
- func ParseTime(timeStr string) t0.Time
- func ParseTimeYmsHms(timeStr string) (t0.Time, error)
- func ParseTimeYmsHmsLoc(timeStr string, loc *t0.Location) (t0.Time, error)
- func ParseTimeYmsHmsS(timeStr string) (t0.Time, error)
- func ParseTimeYmsHmsSLoc(timeStr string, loc *t0.Location) (t0.Time, error)
- func SecondOfDay(t t0.Time) int
- func SecondSpan(now, then t0.Time) float64
- func SecondsBetween(now, then t0.Time) int
- func SecondsToTime(seconds int) (hour int, minute int, second int)
- func TimeInMicro() int64
- func TimeInMillis() int64
- func TimeInNano() int64
- func TimeInSeconds() int64
- func TimeToStringFormat(t t0.Time, format string) string
- func TimeToStringYmdHms(t t0.Time) string
- func TimeToStringYmdHmsS(t t0.Time) string
- func WithInPastDays(now, then t0.Time, days int) bool
- func WithInPastHours(now, then t0.Time, hours int) bool
- func WithInPastMilliSeconds(now, then t0.Time, milliSeconds int64) bool
- func WithInPastMinutes(now, then t0.Time, minutes int) bool
- func WithInPastMonths(now, then t0.Time, months int) bool
- func WithInPastSeconds(now, then t0.Time, seconds int) bool
- func WithInPastYears(now, then t0.Time, years int) bool
- func YearSpan(now, then t0.Time) float64
- func YearsBetween(now, then t0.Time) int
- type FPCDateTime
- type OnTimerFunc
- type Timer
Constants ¶
View Source
const ( DateDelta = 693594 // Days between 1/1/0001 and 12/31/1899 HoursPerDay = 24 MinsPerHour = 60 SecsPerMin = 60 MSecsPerSec = 1000 MinsPerDay = HoursPerDay * MinsPerHour SecsPerHour = SecsPerMin * MinsPerHour SecsPerDay = MinsPerDay * SecsPerMin MSecsPerDay = SecsPerDay * MSecsPerSec OneMillisecond = FPCDateTime(1) / MSecsPerDay HalfMilliSecond = OneMillisecond / 2 JulianEpoch = FPCDateTime(-2415018.5) UnixEpoch = JulianEpoch + FPCDateTime(2440587.5) ApproxDaysPerMonth = 30.4375 ApproxDaysPerYear = 365.25 )
Variables ¶
View Source
var ( Year = "2006" Month = "01" Day = "02" Hour = "15" Minute = "04" Second = "05" FmtYMdHmsSSS = "2006-01-02 15:04:05.000" FmtYMdHmsS = "2006-01-02 15:04:05.0" FmtYMdHms = "2006-01-02 15:04:05" FmtYMdHm = "2006-01-02 15:04" FmtYMdH = "2006-01-02 15" FmtYMd = "2006-01-02" FmtYM = "2006-01" FmtY = "2006" FmtYYYYMMdd = "20060102" FmtHmsSSSMore = "15:04:05.000000000" FmtHmsSSS = "15:04:05.000" FmtHms = "15:04:05" FmtHm = "15:04" FmtH = "15" EmptyTime = t0.Time{} )
Functions ¶
func AddMinutes ¶ added in v1.0.0
func AddSeconds ¶ added in v1.0.0
func CurrentMinuteOfDay ¶ added in v0.7.0
func CurrentMinuteOfDay() int
func CurrentSecondOfDay ¶ added in v0.7.0
func CurrentSecondOfDay() int
func DaysBetween ¶ added in v0.7.0
func HoursBetween ¶ added in v0.7.0
func IsLeapYear ¶ added in v0.7.0
func IsTimeEmpty ¶ added in v1.0.0
func MilliSecondSpan ¶ added in v0.7.0
func MilliSecondsBetween ¶ added in v0.7.0
func MinuteOfDay ¶ added in v0.7.0
func MinuteSpan ¶ added in v0.7.0
func MinutesBetween ¶ added in v0.7.0
func MinutesToTime ¶ added in v0.7.0
func MonthsBetween ¶ added in v0.7.0
func NumToTimeDuration ¶ added in v1.0.12
func ParseTimeYmsHmsLoc ¶
func ParseTimeYmsHmsSLoc ¶
func SecondOfDay ¶ added in v0.7.0
func SecondSpan ¶ added in v0.7.0
func SecondsBetween ¶ added in v0.7.0
func SecondsToTime ¶ added in v0.7.0
func TimeToStringYmdHms ¶
func TimeToStringYmdHmsS ¶
func WithInPastMilliSeconds ¶ added in v0.7.0
func WithInPastMinutes ¶ added in v0.7.0
func WithInPastSeconds ¶ added in v0.7.0
func YearsBetween ¶ added in v0.7.0
Types ¶
type FPCDateTime ¶ added in v0.7.0
type FPCDateTime float64
type OnTimerFunc ¶ added in v1.0.7
type OnTimerFunc func(t *Timer)
type Timer ¶ added in v1.0.7
type Timer struct { Interval int64 IsStopped bool OnTimer OnTimerFunc // 这个函数将在[协程]内异步调用 OnBeforeTimer OnTimerFunc // 这个函数在[主线程]内同步调用 OnAfterTimer OnTimerFunc // 这个函数在[主线程]内同步调用 // contains filtered or unexported fields }
func NewTimerWithFire ¶ added in v1.0.7
func NewTimerWithFire(seconds float64, onTimer OnTimerFunc) *Timer
func NewTimerWithInterval ¶ added in v1.0.7
func (*Timer) SetInterval ¶ added in v1.0.7
func (*Timer) SetOnAfter ¶ added in v1.0.7
func (t *Timer) SetOnAfter(event OnTimerFunc)
func (*Timer) SetOnBefore ¶ added in v1.0.7
func (t *Timer) SetOnBefore(event OnTimerFunc)
func (*Timer) SetOnTimer ¶ added in v1.0.7
func (t *Timer) SetOnTimer(event OnTimerFunc)
Click to show internal directories.
Click to hide internal directories.