How to get date time in JavaScript with format 31/12/2010 03:55 AM?
Date().toLocaleString() returns this: 7/31/2018, 12:58:03 PM
Date().toLocaleString()
7/31/2018, 12:58:03 PM
Pretty close - just drop the comma and the seconds:
new Date().toLocaleString().replace(",","").replace(/:.. /," ");
Results: 7/31/2018 12:58 PM
7/31/2018 12:58 PM