MCPcopy
hub / github.com/spf13/cast / ToTimeE

Function ToTimeE

time.go:19–21  ·  view source on GitHub ↗

ToTimeE any value to a [time.Time] type.

(i any)

Source from the content-addressed store, hash-verified

17
18// ToTimeE any value to a [time.Time] type.
19func ToTimeE(i any) (time.Time, error) {
20 return ToTimeInDefaultLocationE(i, time.UTC)
21}
22
23// ToTimeInDefaultLocationE casts an empty interface to [time.Time],
24// interpreting inputs without a timezone to be in the given location,

Callers 3

TestTimeWithTimezonesFunction · 0.92
ToTimeFunction · 0.85
ToEFunction · 0.85

Calls 1

ToTimeInDefaultLocationEFunction · 0.85

Tested by 1

TestTimeWithTimezonesFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…