NG.I · Angular 22 practice question

A frontend engineer needs to display a timestamp using the `DatePipe`, first specifying the desired time format and then overriding the default timezone setting. Which template syntax correctly achieves this configuration?

<p>Time: {{ eventTime | date: 'HH:mm' : 'America/Los_Angeles' }}</p>
Choose one answer
Check answer and explanation

Correct answer: <p>Time: {{ eventTime | date: 'HH:mm' : 'America/Los_Angeles' }}</p>

Explanation

The proper method for supplying several arguments to a pipe involves using colons as separators, as shown in the example "{{ scheduledOn | date: 'hh:mm' : 'UTC' }}".

Common trap

The syntax employing function-call notation is invalid for pipe parameterization. Furthermore, attempting to sequence pipes instead of passing multiple arguments to a single pipe is incorrect.

Source: Angular docs: Pipes — Passing parameters to pipes
Checked against the cited text on 2026-11-25.

Report an error in this question