I want to convert current data into 'yyyy-MM-dd' format in .ts file. i template it can easily be done by using data pipe. how to do that in typescript.
In template:
{{date | date:'yyyy-MM-dd'}}
How to convert in this format 'yyyy-MM-dd' in typescript.
now i am just getting current date by using this.
this.date = new Date();
but need to convert it into given format. Please guide how to do that... Thanks!