javascript DateÈÕÆÚ¶ÔÏó (ת)
´´½¨Ò»¸öÈÕÆÚ¶ÔÏó£º
var objDate=new Date([arguments list]);
²ÎÊýÐÎʽÓÐÒÔÏ£µÖÖ£º
new Date("month dd,yyyy hh:mm:ss");
new Date("month dd,yyyy");
new Date(yyyy,mth,dd,hh,mm,ss);
new Date(yyyy,mth,dd);
new Date(ms);
ÐèҪעÒâ×îºóÒ»ÖÖÐÎʽ£¬²ÎÊý±íʾµÄÊÇÐèÒª´´½¨µÄʱ¼äºÍGMTʱ¼ä1970Äê1ÔÂ1ÈÕÖ®¼äÏà²îµÄºÁÃëÊý¡£¸÷ÖÖº¯ÊýµÄº¬ÒåÈçÏ£º
month:ÓÃÓ¢ÎıíʾÔ·ÝÃû³Æ£¬´ÓJanuaryµ½December
mth:ÓÃÕûÊý±íʾÔ·ݣ¬´Ó£¨£±Ô£©µ½£±£±£¨£±£²Ô£©
dd:±íʾһ¸öÔÂÖеĵڼ¸Ì죬´Ó1µ½31
yyyy:ËÄλÊý±íʾµÄÄê·Ý
hh:СʱÊý£¬´Ó0£¨ÎçÒ¹£©µ½23£¨Íí11µã£©
mm:·ÖÖÓÊý£¬´Ó0µ½59µÄÕûÊý
ss:ÃëÊý£¬´Ó0µ½59µÄÕûÊý
ms:ºÁÃëÊý£¬Îª´óÓÚµÈÓÚ0µÄÕûÊý
È磺
new Date("January 12,2006 22:19:35");
new Date("January 12,2006");
new Date(2006,0,12,22,19,35);
new Date(2006,0,12);
new Date(1137075575000);
ÉÏÃæµÄ¸÷ÖÖ´´½¨ÐÎʽ¶¼±íʾ2006¡¡Äê1ÔÂ12ÈÕÕâÒ»Ìì¡£
´Ó£Äate ¶ÔÏóÖÐÌáÈ¡ÐÅÏ¢
var objDate=new Date();
objDate.getFullYear()ÒÔËÄλÊý×Ö·µ»ØÄê
objDate.getYear()¸ù¾Ýä¯ÀÀÆ÷²»Í¬£¬ÒÔÁ½Î»»òÕßËÄλÊý×Ö·µ»ØÄê
objDate.getMonth()
objDate.getDate()
objDate.getDay()
objDate.getHours()
objDate.getMilliseconds().
..........
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<script language="JavaScript" type="text/javascript">
<!--
var objDate=new Date();//´´½¨Ò»¸öÈÕÆÚ¶ÔÏó±íʾµ±Ç°Ê±¼ä
var year=objDate.getFullYear();
var month=objDate.getMonth()+1; //getMonth·µ»ØµÄÔ·ÝÊÇ´Ó0¿ªÊ¼µÄ£¬Òò´ËÒª¼Ó1
var date=objDate.getDate();
var day=objDate.getDay();
//¸ù¾ÝÐÇÆÚÊýµÄË÷ÒýÈ·¶¨ÆäÖÐÎıíʾ
switch(day){
&nb
Ïà¹ØÎĵµ£º
ÉîÈëÀí½âJavascript±Õ°ü
×î½üÔÚÍøÉϲéÔÄÁ˲»ÉÙJavascript±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
¡¡¡¡Ò»¡¢Ê²Ã´ÊDZհü£¿
¡¡¡¡“¹Ù·½”µÄ½âÊÍÊÇ£ºËùν“±Õ°ü ......
function getInfo()
{
var s = "";
s += " ÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth+"\n";
s += " ÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight+"\n";
s += " ÍøÒ³¿É¼ ......
Èç¹ûÄãÍêÈ«²»¶®£¬ÄÇôÆÚÍû1-2ÖÜ¿´ÍêÒ»±éÀµ¹....²»Óÿ´µÄÌ«×Ðϸ£¬ºóÃæÔÙ¿´µ½²»¶®µÄʱºò»ØÍ·È¥¿´ÕâЩ¶«Î÷ºÃÁË¡£
1. Ç°ÑÔºÍ×¼±¸¹¤×÷
ÕâÀï²»»á½éÉÜʲôÈí¼þµÄÓ÷¨Ò»ÀàµÄ¶«Î÷¡£Èç¹û¾õµÃÊÖд´úÂëÊÇÔÚ×°µÄÈË¿ÉÒÔ³öÈ¥ÁË£¬Ð»Ð»¡£
Ê×ÏÈÄãÒªÓÐ̨µçÄÔ¡£È»ºóËüÓ¦¸Ã×°×Åwindows ºÍ IE¡£ÏÂÃæËù̸µ½µÄ´úÂë ......