Format date as dd/MM/yyyy using pipes

Pipe date format bug fixed in Angular 2.0.0-rc.2, this Pull Request. Now we can do the conventional way: {{valueDate | date: ‘dd/MM/yyyy’}} Examples: Current Version: Example Angular 13 Old Versions: Example Angular 8.x.x Example Angular 7.x Example Angular 6.x Example Angular 4.x Example Angular 2.x More info in documentation DatePipe

How to set locale in DatePipe in Angular 2?

As of Angular2 RC6, you can set default locale in your app module, by adding a provider: @NgModule({ providers: [ { provide: LOCALE_ID, useValue: “en-US” }, //replace “en-US” with your locale //otherProviders… ] }) The Currency/Date/Number pipes should pick up the locale. LOCALE_ID is an OpaqueToken, to be imported from angular/core. import { LOCALE_ID } … Read more