How to get date time in JavaScript with format 31/12/2010 03:55 AM?
Semantically, you're probably looking for the one-liner
new Date().toLocaleString()
which formats the date in the locale of the user.
If you're really looking for a specific way to format dates, I recommend the moment.js library.