MCPcopy Create free account
hub / github.com/cel-expr/cel-go / timestampGetMonth

Function timestampGetMonth

common/stdlib/standard.go:976–984  ·  view source on GitHub ↗
(ts, tz ref.Val)

Source from the content-addressed store, hash-verified

974}
975
976func timestampGetMonth(ts, tz ref.Val) ref.Val {
977 t, err := inTimeZone(ts, tz)
978 if err != nil {
979 return types.NewErrFromString(err.Error())
980 }
981 // CEL spec indicates that the month should be 0-based, but the Time value
982 // for Month() is 1-based.
983 return types.Int(t.Month() - 1)
984}
985
986func timestampGetDayOfYear(ts, tz ref.Val) ref.Val {
987 t, err := inTimeZone(ts, tz)

Callers 1

initStandardFunction · 0.70

Calls 4

NewErrFromStringFunction · 0.92
IntTypeAlias · 0.92
inTimeZoneFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected