How to get current date in Javascript?

Get current date in Javascript i get the current date by below code. var utc = new Date().toJSON().slice(0,10).replace(/-/g,"-");
Faisal Khan
Asked 27-03-2026
255

Submit your answer