I want to convert current date into 'yyyy-MM-dd'
format in .ts
file. In template it can easily be done by using date 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?
I am just getting current date by using this.
this.date = new Date();
but I need to convert it into the given format.