var today = new Date();
<script type="text/javascript">
var mydate = new Date( "13 Dec 2011 23:58:00" );
document.write( mydate );
</script>
Tue Dec 13 2011 23:58:00 GMT+0800 (中国标准时间)
var someDate = new Date( aYear, aMonth, aDate, anHour, aMinute, aSecond, aMillisecond )
var mydate = new Date( 2011, 11, 14, 23 );
var mydate = new Date( 2011, 11, , 23 );
var mydate = new Date( 2011, 12, 13, 23 );
Fri Jan 13 2012 23:00:00 GMT+0800 (中国标准时间)
//创建一个新的 date 对象
var mydate = new Date( "14 Dec 2011 0:21");
//获取时间元素(分钟,年,月,日)
document.write( "Minutes = " + mydate.getMinutes() + "<br>" );
document.write( "Year = " + mydate.getFullYear() + "<br>" );
document.write( "Month = " + mydate.getMonth() + "<br>" );
document.write( "Date = " + mydate.getDate() + "<br>" );
Sun Jan 01 2012 00:00:00 GMT+0800 (中国标准时间)
Sun Jan 01 2012
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |