angular 8 how to show custom date in input YYYY-MM-DD code example
Example 1: show timestamp as yyyy mm dd html angular
import { DatePipe } from '@angular/common'
...
constructor(public datepipe: DatePipe){}
...
myFunction(){
this.date=new Date();
let latest_date =this.datepipe.transform(this.date, 'yyyy-MM-dd');
}
Example 2: show timestamp as yyyy mm dd html angular
import { DatePipe } from '@angular/common'
...
providers: [DatePipe]