79793888

Date: 2025-10-18 17:46:49
Score: 1.5
Natty:
Report link

If we want on convert the date to human readable format in template

Then use the inbuilt angular date pipe

import { DatePipe } from '@angular/common';

@Component({
  selector: 'app-example',
  imports: [DatePipe], // required
  templateUrl: 'template.component.html'
})

Use date pipe in the template file as

<p>{{ dateVariable | date: 'medium' }}</p>
// output will look as Sep 13, 2025, 6:15 PM
// or 
<p>{{dateVariable | date : "dd/MM/yy HH:mm:ss"}}</p>

Follow the given below link to know other predefined angular date time format

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ShubhCredit