I need to format the JavaScript Date object. It should display date and time in short format with regard to the culture that browser is using, for example:
2
The Date() object will get you the client time (live demo here):
var now=new Date();
alert(now.toLocaleString());
JS and jQuery don't have a built in format function. To format it differently use a function like format()
(1.2kb) here and then the following code will produce a format like "10/10/2012 8:50pm" :
var now=new Date();
alert( now.format("mm/dd/yy h:MM:ss TT") );