Documentation ¶
Overview ¶
Package tsutil provides timestamp and time utilities.
Index ¶
Constants ¶
View Source
const (
// RFC3339Milli is RFC3339 with millisecond precision.
RFC3339Milli = "2006-01-02T15:04:05.000Z07:00"
)
Variables ¶
This section is empty.
Functions ¶
func NowMillis ¶ added in v0.1.20
func NowMillis() int64
NowMillis returns now in milliseconds since epoch.
func ParseMillis ¶
ParseMillis returns time.Time from milliseconds since epoch.
Types ¶
type Clock ¶
type Clock interface { // Now returns current clock time. Now() time.Time // NowMillis returns current time in milliseconds. NowMillis() int64 // Add time to clock. Add(dt time.Duration) }
Clock returns time.Time.
func NewTestClock ¶ added in v0.1.2
func NewTestClock() Clock
NewTestClock returns a test Clock starting at 1234567890000 millseconds since epoch. Each access to Now() increases time by 1 millisecond.
func NewTestClockAt ¶ added in v0.1.2
NewTestClockAt creates a Clock starting at timestamp (millis).
Click to show internal directories.
Click to hide internal directories.