MCPcopy
hub / github.com/flosch/pongo2 / Time

Method Time

value.go:197–203  ·  view source on GitHub ↗

Time returns the underlying value as time.Time. If the underlying value is not a time.Time, it returns the zero value of time.Time.

()

Source from the content-addressed store, hash-verified

195// Time returns the underlying value as time.Time.
196// If the underlying value is not a time.Time, it returns the zero value of time.Time.
197func (v *Value) Time() time.Time {
198 tm, ok := v.Interface().(time.Time)
199 if ok {
200 return tm
201 }
202 return time.Time{}
203}
204
205// IsTrue tries to evaluate the underlying value the Pythonic-way:
206//

Callers 2

EqualValueToMethod · 0.95
EvaluateMethod · 0.80

Calls 1

InterfaceMethod · 0.95

Tested by

no test coverage detected