Angular marks DATE_PIPE_DEFAULT_TIMEZONE as deprecated. Replace it with DATE_PIPE_DEFAULT_OPTIONS and set its timezone field. If you do not configure a timezone, DatePipe uses the end user’s local system timezone.
Replace the deprecated token
Angular’s API documentation recommends DATE_PIPE_DEFAULT_OPTIONS to configure DatePipe. Provide a DatePipeConfig object with a timezone value:
As an Amazon Associate I earn from qualifying purchases.
import { DATE_PIPE_DEFAULT_OPTIONS } from '@angular/common';
providers: [
{
provide: DATE_PIPE_DEFAULT_OPTIONS,
useValue: { timezone: '+0430' },
},
]
The documented configuration object can also include dateFormat. The API’s timezone example is the UTC offset '+0430'; do not assume that every named IANA timezone is accepted. See Angular’s deprecated token notice and replacement token API.
Recommended Free Tools
Set a timezone for one template expression
To use a different timezone for a particular value, pass it as the DatePipe argument after the format:
#1 Best Overall
{{ scheduledOn | date: 'hh:mm' : 'UTC' }}
An explicit timezone on the expression takes precedence over the configured application default. Angular’s pipe guide documents the UTC example.
What DatePipe does with inputs and locales
DatePipe accepts a JavaScript Date, a number of milliseconds since the UTC epoch, or an ISO string. It formats the value according to locale rules. Angular includes only en-US locale data by default; import the data for another locale if your application needs it. The DatePipe API documents accepted values, formatting, and locale behavior.
Rank #2
Account for DatePipe’s pure-change behavior
DatePipe is pure: changing the contents of an existing Date object does not cause the pipe to run again. When a date changes, assign a new Date object reference so Angular can detect the change and reformat it. This behavior is documented in the DatePipe API and DatePipeConfig API.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




