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!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…