如何利用javascript 获得当前时间 ,格式如: 2008-06-15 15:41:11
解决方案 »
- Chrome下解析XML Document
- JSON问题
- javascript时钟显示,这样好不好,感觉危险来
- ************问个javascript问题********************
- 最简单的问题,如何使用javascript脚本弹出ftp窗口,具体说明见贴子内容?
- 600分~征集面试题~|asp|jsp|html|javascript|sql|
- C#与Javascript交互问题
- js文件的问题
- 能否实现:一个button本来是'灰'的,担当页面中的任何一个checkbox被选中时,
- js怎么让页面中所有控件ID开头一样全部隐藏
- IE打印时,怎样才能让不弹出打印对话框
- 使iframe 在ie 和 firefox 上的問題
now.getYear()+'-'+(now.getMonth()+1)+'-'+now.getDate()+' '+now.getHours()+':'+now.getMinutes()+":"+now.getSeconds()
var now = new Date();
var time = now.getFullYear() + "-" +
(now.getMonth() + 1) + "-" +
now.getDate() + " " +
now.getHours() + ":" +
now.getMinutes() + ":" +
now.getSeconds();
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
(month < 10) ? (month = '0'+month) : month;
var date = now.getDate();
var Temp = year + '-' + month + '-' + date + ' ' + Date().split(" ")[3] ;
alert(Temp);
//-->
</SCRIPT>
</HEAD> <BODY>
</BODY>
</HTML>