date_expression | date[:format]
in your case
{{ date_expression | date:'dd-MM-yy' }}
How to use the pipe inside the component :
NgModule({
....
providers: [DatePipe]
})
or
@Component({
....
providers: [DatePipe]
})
In you component set it as a date variable
constructor(private datePipe: DatePipe) {
}
ngOnInit() {
this.date = this.datePipe.transform(new Date(), 'dd-MM-yy');
}