timeutil

package
v0.0.0-...-4abda61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Clock clock.Clock
View Source
var MockedClock *clock.Mock

Functions

func MockClock

func MockClock()

MockClock sets the MockedClock field to a mock and sets the Clock field to the mock instance

func NowRoundedForGranularity

func NowRoundedForGranularity() time.Time

NowRoundedForGranularity returns a time.Time rounded to microsecond resolution postgres only supports microsecond resolution, so round when inserting (otherwise tests that read/write to db may fail due to rounding)

func RoundForGranularity

func RoundForGranularity(t time.Time) time.Time

RoundForGranularity rounds any time to the granularity specified in postgres.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL