MCPcopy Index your code
hub / github.com/coder/coder / NowInDefaultTimezone

Function NowInDefaultTimezone

coderd/database/dbtestutil/db.go:84–90  ·  view source on GitHub ↗

NowInDefaultTimezone returns the current time rounded to the nearest microsecond in the default timezone used by postgres in tests. Useful for object equality checks.

()

Source from the content-addressed store, hash-verified

82// NowInDefaultTimezone returns the current time rounded to the nearest microsecond in the default timezone
83// used by postgres in tests. Useful for object equality checks.
84func NowInDefaultTimezone() time.Time {
85 loc, err := time.LoadLocation(DefaultTimezone)
86 if err != nil {
87 panic(err)
88 }
89 return time.Now().In(loc).Round(time.Microsecond)
90}
91
92func NewDB(t testing.TB, opts ...Option) (database.Store, pubsub.Pubsub) {
93 t.Helper()

Callers 5

TestAPIKeyFunction · 0.92
TestNotificationsMethod · 0.92
TestFindMatchingPresetIDFunction · 0.92
setupUserFunction · 0.92

Calls

no outgoing calls

Tested by 5

TestAPIKeyFunction · 0.74
TestNotificationsMethod · 0.74
TestFindMatchingPresetIDFunction · 0.74
setupUserFunction · 0.74