We would like to know how to format date output '10:16:07 7/6/2015'.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!--from ww w.j a v a 2s . c om-->
var date=new Date();
var arr=date.toLocaleString().split(' ');
document.write(arr[1]+" "+arr[0]);
}
</script>
</head>
<body>
</body>
</html>
The code above is rendered as follows: