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

Function timeDisplay

cli/util.go:82–89  ·  view source on GitHub ↗

timeDisplay formats a time in the local timezone in RFC3339 format.

(t time.Time)

Source from the content-addressed store, hash-verified

80// timeDisplay formats a time in the local timezone
81// in RFC3339 format.
82func timeDisplay(t time.Time) string {
83 localTz, err := tz.TimezoneIANA()
84 if err != nil {
85 localTz = time.UTC
86 }
87
88 return t.In(localTz).Format(time.RFC3339)
89}
90
91// relative relativizes a duration with the prefix "ago" or "in"
92func relative(d time.Duration) string {

Callers 1

Calls 2

TimezoneIANAFunction · 0.92
FormatMethod · 0.65

Tested by

no test coverage detected