I want to display the current date in the format 1st January, 2020 or January 1st, 2020. From new Date(), I get something like Wed Jun 10 2020 22:05:14.... How do I convert that to Jun 10th, 2020?
Asked
Active
Viewed 18 times
0
Muneeb Naveed
- 83
- 1
- 10
-
1Hey! this might be a duplicate of the question https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date There you can find the answers to the problem you are currently having – Sebastian Cristi Castillo Jun 10 '20 at 17:13
-
There is no native js function to do that, but here is a possible answer: [https://stackoverflow.com/questions/13627308/add-st-nd-rd-and-th-ordinal-suffix-to-a-number] --- Add st-nd-rd-th suffix to number) – Cypherjac Jun 10 '20 at 17:13