Versions in this module Expand all Collapse all v0 v0.23.2 Feb 12, 2024 Changes in this version + const DateFormat + const FullTimeFormat + const LibPQTimePrefix + const TimeWithTZFormat + const TimeWithoutTZFormat + const TimestampWithTZFormat + const TimestampWithoutTZFormat + var UnixEpoch = time.Unix(0, 0).UTC() + func FixedTimeZoneOffsetToLocation(offset int, origRepr string) *time.Location + func FromUnixMicros(us int64) time.Time + func FromUnixNanos(ns int64) time.Time + func LoadLocation(name string) (*time.Location, error) + func Now() time.Time + func NowNoMono() time.Time + func ParseTimeZoneOffset(location string, standard TimeZoneStringToLocationStandard) (offset int, origRepr string, success bool) + func ReplaceLibPQTimePrefix(s string) string + func RunWithTimeout(ctx context.Context, op string, timeout time.Duration, ...) error + func Since(t time.Time) time.Duration + func StripMono(t time.Time) time.Time + func TimeZoneOffsetToLocation(offset int) *time.Location + func TimeZoneStringToLocation(locStr string, std TimeZoneStringToLocationStandard) (*time.Location, error) + func TimeZones() []string + func ToUnixMicros(t time.Time) int64 + func Unix(sec, nsec int64) time.Time + func Until(t time.Time) time.Duration + type CPUStopWatch struct + func NewCPUStopWatch() *CPUStopWatch + func (w *CPUStopWatch) Elapsed() time.Duration + func (w *CPUStopWatch) Start() + func (w *CPUStopWatch) Stop() + type DefaultTimeSource struct + func (DefaultTimeSource) NewTicker(duration time.Duration) TickerI + func (DefaultTimeSource) NewTimer() TimerI + func (DefaultTimeSource) Now() time.Time + func (DefaultTimeSource) Since(t time.Time) time.Duration + type ManualTime struct + func NewManualTime(initialTime time.Time) *ManualTime + func (m *ManualTime) Advance(duration time.Duration) + func (m *ManualTime) AdvanceTo(now time.Time) + func (m *ManualTime) Backwards(duration time.Duration) + func (m *ManualTime) MustAdvanceTo(now time.Time) + func (m *ManualTime) NewTicker(duration time.Duration) TickerI + func (m *ManualTime) NewTimer() TimerI + func (m *ManualTime) Now() time.Time + func (m *ManualTime) Since(t time.Time) time.Duration + func (m *ManualTime) Timers() []time.Time + type StopWatch struct + func NewStopWatch() *StopWatch + func NewStopWatchWithCPU() *StopWatch + func NewTestStopWatch(timeSource func() time.Time) *StopWatch + func (w *StopWatch) Elapsed() time.Duration + func (w *StopWatch) ElapsedCPU() time.Duration + func (w *StopWatch) LastStartedAt() (startedAt time.Time, started bool) + func (w *StopWatch) Start() + func (w *StopWatch) Stop() + type TestTimeSource struct + func NewTestTimeSource() *TestTimeSource + func (t *TestTimeSource) Advance() + func (t *TestTimeSource) Elapsed() time.Duration + func (t *TestTimeSource) Now() time.Time + type TickerI interface + Ch func() <-chan time.Time + Reset func(duration time.Duration) + Stop func() + type TimeSource interface + NewTicker func(duration time.Duration) TickerI + NewTimer func() TimerI + Now func() time.Time + Since func(t time.Time) time.Duration + type TimeZoneStringToLocationStandard uint32 + const TimeZoneStringToLocationISO8601Standard + const TimeZoneStringToLocationPOSIXStandard + type TimeoutError struct + func (*TimeoutError) Temporary() bool + func (*TimeoutError) Timeout() bool + func (t *TimeoutError) Cause() error + func (t *TimeoutError) Error() string + func (t *TimeoutError) Format(s fmt.State, verb rune) + func (t *TimeoutError) Operation() string + func (t *TimeoutError) SafeFormatError(p errors.Printer) (next error) + type Timer struct + C <-chan time.Time + Read bool + func NewTimer() *Timer + func (t *Timer) Reset(d time.Duration) + func (t *Timer) Stop() bool + type TimerI interface + Ch func() <-chan time.Time + MarkRead func() + Reset func(duration time.Duration) + Stop func() bool