I am new to angular and looking to format date in component ngOnInit method. I have seen some example where pipe operator are used to format the data but i dont know how to format date in component file.
below is code
export class DashboardComponent implements OnInit {
formatdate = 'dd/MM/yyyy';
constructor(private auth: AuthService) { }
ngOnInit() {
console.log(new Date().toISOString())
}
}