How format JavaScript Date with regard to the browser culture?
问题 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: 20/10/2011 10:20 PM 10.20.2011 22:20 How do I do this (preferably with jQuery)? 回答1: 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