Documentation ¶
Index ¶
- Constants
- func Difference(t1 TimeOfDay, t2 TimeOfDay) duration.Duration
- type TimeOfDay
- func (t TimeOfDay) Add(d duration.Duration) TimeOfDay
- func (t TimeOfDay) Hour() int
- func (t TimeOfDay) Microsecond() int
- func (t TimeOfDay) Minute() int
- func (t TimeOfDay) Round(precision time.Duration) TimeOfDay
- func (t TimeOfDay) Second() int
- func (t TimeOfDay) String() string
- func (t TimeOfDay) ToTime() time.Time
Constants ¶
View Source
const ( // Min is the minimum TimeOfDay value (midnight). Min = TimeOfDay(0) // Time2400 is a special value to represent the 24:00 input time Time2400 = TimeOfDay(microsecondsPerDay) // Max is the maximum TimeOfDay value (1 second before midnight) Max = Time2400 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TimeOfDay ¶
type TimeOfDay int64
TimeOfDay represents a time of day (no date), stored as microseconds since midnight.
func FromInt ¶
FromInt constructs a TimeOfDay from an int64, representing microseconds since midnight. Inputs outside the range [0, microsecondsPerDay) are modded as appropriate.
func FromTimeAllow2400 ¶
FromTimeAllow2400 assumes 24:00 time is possible from the given input, otherwise falling back to FromTime. It assumes time.Time is represented as lib/pq or as unix time.
func (TimeOfDay) Microsecond ¶
Microsecond returns the microsecond offset within the second specified by t, in the range [0, 999999].
func (TimeOfDay) Minute ¶
Minute returns the minute offset within the hour specified by t, in the range [0, 59].
Click to show internal directories.
Click to hide internal directories.