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

Function Time

coderd/database/dbtime/dbtime.go:16–18  ·  view source on GitHub ↗

Time returns a time compatible with Postgres. Postgres only stores dates with microsecond precision. FIXME(dannyk): refactor all calls to Time() to expect the input time to be modified to UTC; there are currently a few calls whose behavior would change subtly. See https://github.com/coder/coder/p

(t time.Time)

Source from the content-addressed store, hash-verified

14// few calls whose behavior would change subtly.
15// See https://github.com/coder/coder/pull/14274#discussion_r1718427461
16func Time(t time.Time) time.Time {
17 return t.Round(time.Microsecond)
18}
19
20// StartOfDay returns the first timestamp of the day of the input timestamp in its location.
21func StartOfDay(t time.Time) time.Time {

Callers 15

createWorkspaceFunction · 0.92
putWorkspaceAutostartMethod · 0.92
putWorkspaceTTLMethod · 0.92
putWorkspaceDormantMethod · 0.92
putExtendWorkspaceMethod · 0.92
tasksCreateMethod · 0.92
taskDeleteMethod · 0.92
workspaceBuildsMethod · 0.92
newSuccessfulDispatchMethod · 0.92
newFailedDispatchMethod · 0.92
newInhibitedDispatchMethod · 0.92

Calls

no outgoing calls

Tested by 6

TestGetUserStatusCountsFunction · 0.74
TestUpdateLifecycleFunction · 0.74
TestGetManifestFunction · 0.74
TestUpdateStatsFunction · 0.74
TestConnectionLogFunction · 0.74
dbnowFunction · 0.74