angular date pipe 24h format code example

Example 1: date format angular

content_copy
      
      @Component({
 selector: 'date-pipe',
 template: `<div>
   <p>Today is {{today | date}}</p>
   <p>Or if you prefer, {{today | date:'fullDate'}}</p>
   <p>The time is {{today | date:'h:mm a z'}}</p>
 </div>`
})
// Get the current date and time as a date-time value.
export class DatePipeComponent {
  today: number = Date.now();
}

Example 2: angular date pipe 24 hour format

{{ todayDate | date: 'dd/MM/yyyy HH:mm'}} :  equivalent to (23/12/2020, 15:03).