<script> function format(f) { return f.getFullYear() + '-' + (f.getMonth() + 1) + '-' + f.getDate(); } function loadfn(){ alert(format(new Date())); } </script>
<script> function format(f) { return f.getFullYear() + '-' + (f.getMonth() + 1) + '-' + f.getDate(); } function loadfn(){ alert(format(new Date())); } </script>