Home > database >  How to format fetched date in reactJS
How to format fetched date in reactJS

Time:05-11

Hi I have fetched date/data but it showing like that "2022-05-14T14:00:00.000Z". How to convert this to 14/05/2022?

 <FetchedDate>
   {date}
 </FetchedDate> 

Thank you for anyone help.

CodePudding user response:

new Date(date).toLocaleDateString('en-GB');

enter image description here

  • Related