What you will do
You will run the prepared expression in the playground above, change one input at a time, and explain the result. Start in CEL only, then repeat the same rule in CEL + JSON.
How it works
A timestamp is an absolute instant; a duration is an elapsed amount of time. The source value starts as an RFC 3339 string, so timestamp(start) parses it explicitly. Adding duration("2h30m") creates a new timestamp two hours and thirty minutes later.
Read the prepared example
The CEL + JSON rule is:
timestamp(start) + duration('2h30m')Its input is:
{
"start": "2026-07-23T08:00:00Z"
}The CEL only tab contains the values and the rule in one expression. The enabled cel.bind() extension keeps each name local to its final argument.
Evaluation step by step
- The start string becomes
2026-07-23T08:00:00Zas a timestamp. - The duration equals 2 hours and 30 minutes.
- Addition returns
2026-07-23T10:30:00Z.
Your task
- Run both modes.
- Change the duration to
45m. - Enter an invalid start such as
23 Julyand read the parsing error.
Expected observation: A 45-minute duration returns 08:45:00Z; non-RFC-3339 text is rejected.
Common mistake
Do not add a number directly to a timestamp. Time arithmetic uses a duration, which carries a time unit.
Show the explanation
A new timestamp.
Knowledge check
What type does timestamp plus duration return?
Key takeaway
Parse external time text explicitly and perform time arithmetic with typed durations.
Sources
CEL-DEV— official CEL overview.CEL-LANG— official CEL language definition.CEL-GO-BIND— official documentation for the optionalcel.bind()extension used by the self-contained tab.