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

Function timestampGetMonth

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

Source from the content-addressed store, hash-verified

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

Callers 1

initFunction · 0.70

Calls 4

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

Tested by

no test coverage detected