0

I am using React Date Picker to get the dates,As of now I am receiving the date as :Fri Feb 01 2019 00:00:00 GMT+0530 (India Standard Time) and now I want to format it in ""YYYY-MM-DD" format.Is there a way to achieve this in React js?

I tried doing this but didn't helped:

date=this.state.startDate.getDate() + "-"+ parseInt(this.state.startDate.getMonth()+1) +"-"+this.state.startDate.getFullYear();
kinnu
  • 396
  • 2
  • 12
  • 22

0 Answers0