package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
FixedTimeZoneOffsetToLocation creates a time.Location with an offset and a time zone string.
FromUnixMicros returns the UTC time.Time corresponding to the given Unix time, usec microseconds since UnixEpoch.
FromUnixNanos returns the UTC time.Time corresponding to the given Unix time, ns nanoseconds since UnixEpoch.
LoadLocation returns the time.Location with the given name.
NewCPUStopWatch returns a new CPUStopWatch if the grunning library is supported.
NewManualTime constructs a new ManualTime.
NewStopWatch creates a new StopWatch.
NewStopWatchWithCPU creates a new StopWatch that will track CPU usage in addition to wall-clock time.
NewTestStopWatch create a new StopWatch with the given time source.
NewTestTimeSource create a new TestTimeSource.
Now returns the current UTC time.
NowNoMono is like Now(), but it strips down the monotonic part of the timestamp.
ParseTimeZoneOffset takes the string representation of a time.Location created by TimeZoneOffsetToLocation and parses it to the offset and the original representation specified by the user.
ReplaceLibPQTimePrefix replaces unparsable lib/pq dates used for timestamps (0000-01-01) with timestamps that can be parsed by date libraries.
RunWithTimeout runs a function with a timeout, the same way you'd do with context.WithTimeout.
Since returns the time elapsed since t.
StripMono returns a copy of t with its monotonic clock reading stripped.
TimeZoneOffsetToLocation takes an offset and name that can be marshaled by crdb between nodes and creates a time.Location.
TimeZones lists all supported timezones.
TimeZoneStringToLocation transforms a string into a time.Location.
ToUnixMicros returns t as the number of microseconds elapsed since UnixEpoch.
Unix wraps time.Unix ensuring that the result is in UTC instead of Local.
Until returns the duration until t.
# Constants
DateFormat is the time format used to display a date.
FullTimeFormat is the time format used to display any unknown timestamp type, and always shows the full time zone offset.
LibPQTimePrefix is the prefix lib/pq prints time-type datatypes with.
TimestampWithoutTZFormat is the time format used to display timestamps without a time zone offset.
TimestampWithTZFormat is the time format used to display timestamps with a time zone offset.
TimeWithoutTZFormat is the time format used to display a time without a time zone offset.
TimeWithTZFormat is the time format used to display a time with a time zone offset.
TimeZoneStringToLocationISO8601Standard parses int UTC offsets as *east* of the GMT line, e.g.
TimeZoneStringToLocationPOSIXStandard parses int UTC offsets as *west* of the GMT line, e.g.
# Variables
UnixEpoch represents the Unix epoch, January 1, 1970 UTC.
# Structs
CPUStopWatch is a wrapper around cpuStopWatch that is safe to use concurrently.
DefaultTimeSource is a TimeSource using the system clock.
ManualTime is a testing implementation of TimeSource.
StopWatch is a utility stop watch that can be safely started and stopped multiple times and can be used concurrently.
TestTimeSource is a source of time that remembers when it was created (in terms of the real time) and returns the time based on its creation time and the number of "advances" it has had.
TimeoutError is a wrapped ContextDeadlineExceeded error.
The Timer type represents a single event.
# Interfaces
TickerI is an interface wrapping Ticker.
TimerI is an interface wrapping Timer.
TimeSource is used to interact with clocks and timers.
# Type aliases
TimeZoneStringToLocationStandard is an option for the standard to use for parsing in TimeZoneStringToLocation.