Documentation ¶
Index ¶
- Constants
- type DayElapsed
- type DayHours
- type HourElapsed
- type MicroElapsed
- type MilliElapsed
- type MonthElapsed
- type NanoElapsed
- type SecElapsed
- type Time
- func (t Time) AddDuration(d protocol.Duration) (new Time)
- func (t Time) CallendarYearElapsed() (year int64)
- func (t *Time) ChangeTo(sec SecElapsed, nsecElapsed int32)
- func (t Time) DayElapsed() (day DayElapsed)
- func (t *Time) DayHours() (hour DayHours)
- func (t *Time) Epoch() protocol.TimeEpoch
- func (t Time) HourElapsed() (hour HourElapsed)
- func (t *Time) Local() (loc Time)
- func (t Time) MicroElapsed() MicroElapsed
- func (t Time) MilliElapsed() MilliElapsed
- func (t Time) MonthElapsed() (month MonthElapsed)
- func (t Time) NanoElapsed() NanoElapsed
- func (t *Time) NanoSecondElapsed() int32
- func (t *Time) Now()
- func (t *Time) NowAtomic()
- func (t Time) Pass(from Time) (pass bool)
- func (t Time) SecElapsed() SecElapsed
- func (t *Time) SecondElapsed() int64
- func (t *Time) ToString() string
- func (t Time) TropicalYearElapsed() (year int64)
- func (t Time) Until(to Time) (until Time)
- func (t Time) UntilTo(to Time) (duration protocol.Duration)
- func (t *Time) Weekdays() (day Weekdays)
- type Weekdays
Constants ¶
const ( Nanosecond protocol.Duration = 1 Microsecond = 1000 * Nanosecond Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute Day = 24 * Hour Week = 7 * Day // TropicalYear also known as a solar year - https://en.wikipedia.org/wiki/Tropical_year TropicalYear = (365 * 24 * 60 * 60) + (5 * 60 * 60) + (48 * 60) + 46 // 365.24219 * 24 * 60 * 60 = 31,556,925.216 )
Common durations.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DayElapsed ¶
type DayElapsed int64 // utc.Now().DayElapsed()
Elapsed types specified time elapsed of January 1 of the absolute year. January 1 of the absolute year(0001), like January 1 of 2001, was a Monday.
type DayHours ¶
type DayHours uint32
A DayHours specifies a hour of a day.
const ( DayHours_None DayHours = 0 DayHours_0 DayHours = (1 << iota) DayHours_1 DayHours_2 DayHours_3 DayHours_4 DayHours_5 DayHours_6 DayHours_7 DayHours_8 DayHours_9 DayHours_10 DayHours_11 DayHours_12 DayHours_13 DayHours_14 DayHours_15 DayHours_16 DayHours_17 DayHours_18 DayHours_19 DayHours_20 DayHours_21 DayHours_22 DayHours_23 DayHours_All DayHours = 0b11111111111111111111111111111111 )
Hours
type HourElapsed ¶
type HourElapsed int64 // utc.Now().HourElapsed()
Elapsed types specified time elapsed of January 1 of the absolute year. January 1 of the absolute year(0001), like January 1 of 2001, was a Monday.
type MicroElapsed ¶
type MicroElapsed int64
Elapsed types specified time elapsed of January 1 of the absolute year. January 1 of the absolute year(0001), like January 1 of 2001, was a Monday.
type MilliElapsed ¶
type MilliElapsed int64
Elapsed types specified time elapsed of January 1 of the absolute year. January 1 of the absolute year(0001), like January 1 of 2001, was a Monday.
type MonthElapsed ¶
type MonthElapsed int64 // utc.Now().MonthElapsed()
Elapsed types specified time elapsed of January 1 of the absolute year. January 1 of the absolute year(0001), like January 1 of 2001, was a Monday.
type NanoElapsed ¶
type NanoElapsed int64
Elapsed types specified time elapsed of January 1 of the absolute year. January 1 of the absolute year(0001), like January 1 of 2001, was a Monday.
type SecElapsed ¶
type SecElapsed int64 // utc.Now().SecondElapsed()
Elapsed types specified time elapsed of January 1 of the absolute year. January 1 of the absolute year(0001), like January 1 of 2001, was a Monday.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func (Time) AddDuration ¶
AddDuration return given time plus given duration
func (Time) CallendarYearElapsed ¶
func (*Time) ChangeTo ¶
func (t *Time) ChangeTo(sec SecElapsed, nsecElapsed int32)
func (Time) DayElapsed ¶
func (t Time) DayElapsed() (day DayElapsed)
func (Time) HourElapsed ¶
func (t Time) HourElapsed() (hour HourElapsed)
func (Time) MicroElapsed ¶
func (t Time) MicroElapsed() MicroElapsed
func (Time) MilliElapsed ¶
func (t Time) MilliElapsed() MilliElapsed
func (Time) MonthElapsed ¶
func (t Time) MonthElapsed() (month MonthElapsed)
func (Time) NanoElapsed ¶
func (t Time) NanoElapsed() NanoElapsed
func (*Time) NanoSecondElapsed ¶
func (Time) SecElapsed ¶
func (t Time) SecElapsed() SecElapsed
func (*Time) SecondElapsed ¶
func (Time) TropicalYearElapsed ¶
type Weekdays ¶
type Weekdays uint8
A Weekdays specifies a day of the week. can use by multiple state e.g. Weekdays_Saturday|Weekdays_Monday
const ( Weekdays_None Weekdays = 0b00000000 Weekdays_Monday Weekdays = 0b00000001 Weekdays_Tuesday Weekdays = 0b00000010 Weekdays_Wednesday Weekdays = 0b00000100 Weekdays_Thursday Weekdays = 0b00001000 Weekdays_Friday Weekdays = 0b00010000 Weekdays_Saturday Weekdays = 0b00100000 Weekdays_Sunday Weekdays = 0b01000000 Weekdays_All Weekdays = 0b11111111 )
Weekdays