Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript Date ¶ÔÏóÓ뺯Êý

JavaScript Date ¶ÔÏóÓ뺯Êý
Ŀ¼
JavaScript_Date¶ÔÏó˵Ã÷
Date¶ÔÏó¹¹Ô캯Êý
Dateº¯ÊýʹÓÃÓï·¨
JavaScript_Dateº¯Êý°´¹¦ÄÜ·ÖÀà
ÈÕÆÚ»ñÈ¡ÀຯÊý
ÈÕÆÚÉèÖÃÀຯÊý
ÈÕÆÚ´òÓ¡ÀຯÊý
ÈÕÆÚ½âÎöÀຯÊý
JavaScript_Dateº¯Êý°´ÕÕ×Öĸ·ÖÀà
JavaScript_Date¶ÔÏó˵Ã÷
DateÖÐÎÄΪ"ÈÕÆÚ"µÄÒâ˼£¬Date¼Ì³Ð×ÔObject¶ÔÏ󣬴˶ÔÏóÌṩ²Ù×÷£¬ÏÔʾÈÕÆÚÓëʱ¼äµÄº¯Êý
ÒýÓÃÍøÖ·:http://www.dreamdu.com/javascript/object_date/
Date¶ÔÏó¹¹Ô캯Êý
Date¶ÔÏó¾ßÓжàÖÖ¹¹Ô캯Êý¡£
new Date()
new Date(milliseconds)
new Date(datestring)
new Date(year, month)
new Date(year, month, day)
new Date(year, month, day, hours)
new Date(year, month, day, hours, minutes)
new Date(year, month, day, hours, minutes, seconds)
new Date(year, month, day, hours, minutes, seconds, microseconds)
Date¶ÔÏó¹¹Ô캯Êý²ÎÊý˵Ã÷
milliseconds - ¾àÀëJavaScriptÄÚ²¿¶¨ÒåµÄÆðʼʱ¼ä1970Äê1ÔÂ1ÈյĺÁÃëÊý
datestring - ×Ö·û´®´ú±íµÄÈÕÆÚÓëʱ¼ä¡£´Ë×Ö·û´®¿ÉÒÔʹÓÃDate.parse()ת»»
year - ËÄλÊýµÄÄê·Ý£¬Èç¹ûȡֵΪ0-99£¬ÔòÔÚÆäÖ®ÉϼÓÉÏ1900
month - 0(´ú±íÒ»ÔÂ)-11(´ú±íÊ®¶þÔÂ)Ö®¼äµÄÔ·Ý
day - 1-31Ö®¼äµÄÈÕÆÚ
hours - 0(´ú±íÎçÒ¹)-23Ö®¼äµÄСʱÊý
minutes - 0-59Ö®¼äµÄ·ÖÖÓÊý
seconds - 0-59Ö®¼äµÄÃëÊý
microseconds - 0-999Ö®¼äµÄºÁÃëÊý
Date¶ÔÏó·µ»ØÖµ
Èç¹ûûÓÐÈκβÎÊý£¬½«·µ»Øµ±Ç°ÈÕÆÚ
Èç¹û²ÎÊýΪһ¸öÊý×Ö£¬½«Êý×ÖÊÓΪºÁÃëÖµ£¬×ª»»ÎªÈÕÆÚ
Èç¹û²ÎÊýΪһ¸ö×Ö·û´®£¬½«×Ö·û´®ÊÓΪÈÕÆÚµÄ×Ö·û´®±íʾ£¬×ª»»ÎªÈÕÆÚ
»¹¿ÉÒÔʹÓÃÁù¸ö¹¹Ô캯Êý¾«È·¶¨Ò壬²¢·µ»Øʱ¼ä
ʾÀý
var d1 = new Date();
document.write(d1.toString());
var d2 = new Date("2009-08-08 12:12:12);
document.write(d2.toString());
var d3 = new Date(2009, 8, 8);
document.write(d3.toString());

Date×öΪJavaScriptµÄÒ»ÖÖÄÚÖöÔÏ󣬱ØÐëʹÓÃnewµÄ·½Ê½´´½¨¡£
Date¶ÔÏóÔÚJavaScriptÄÚ²¿µÄ±íʾ·½Ê½ÊÇ£¬¾à1970Äê1ÔÂ1ÈÕÎçÒ¹(GMTʱ¼ä)µÄºÁÃëÊý(ʱ¼ä´Á)£¬ÎÒÃÇÔÚÕâÀïÒ²°ÑDateµÄÄÚ²¿±íʾÐÎʽ³ÆΪʱ¼ä´Á¡£¿ÉÒÔʹÓÃgetTime()½«Date¶ÔÏóת»»ÎªDateµÄʱ¼ä´Á£¬·½·¨setTime()¿ÉÒÔ°ÑDateµÄʱ¼ä´Áת»»ÎªDateµÄ±ê×¼ÐÎʽ¡£
Dateº¯ÊýʹÓÃÓï·¨
date.·½·¨Ãû(²ÎÊý1,²ÎÊý2,...);
Date.·½·¨Ãû();
date´ú±íÒ»¸öÈÕÆÚ¶ÔÏóµÄʵÀý£¬Date´ú±íÈÕÆÚ¶ÔÏó£¬date.·½·¨Ãûµ÷ÓÃ


Ïà¹ØÎĵµ£º

¼òµ¥µÄjavascriptÍÏקʵÀý

¼òµ¥µÄjavascriptÍÏקʵÀý----> ±¾ÈËÔ­´´£¨244796562@qq.com£©
<html>
<head>
<title>ÍÏק²âÊÔ</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div id="box" style="position:absolute;top:100px;left:200px;width ......

JavascriptµÄcallerµ½µ×ÊÇʲôʱºò¶¨ÒåµÄÄØ£¿

 ÍøÉϺܶàÎÄÕ¶¼×ªÔØÁËÒ»¶Î»°£º¶ÔÓÚº¯ÊýÀ´Ëµ£¬caller ÊôÐÔÖ»ÓÐÔÚº¯ÊýÖ´ÐÐʱ²ÅÓж¨Òå¡£
µ½µ×ÊDz»ÊÇÄØ£¿¿ÉÒÔÓÃÏÂÃæÕâ¶Î´úÂë²âÊÔһϣ¨Õâ¶ÎÀý×ÓÒ²ÊÇתÔØÎÄÕÂÖÐʹÓõģ©£º
function callerDemo() {
if (callerDemo.caller) {
var a= callerDemo.caller.toString();
alert(a);
} else {
......

JavaScriptÃæÏò¶ÔÏó³ÌÐòÉè¼Æ(7): ±Õ°ü

 ±¾²©¿ÍתÔØÓÚ£ºhttp://devbean.javaeye.com/blog/409566
±Õ°üÕâ¸ö¸ÅÄî¿´ÉÏÈ¥ºÜÉî°Â£¬Õâ¸ö´ÊÔÚÀëÉ¢ÊýѧÀïÃæµÄÒâ˼ȷʵ±È½ÏÄÑÓÚÀí½â¡£ÔÚÕâÀÎÒÃÇÏÈ¿ÉÒ԰ѱհüÀí½â³ÉÊÇÒ»ÖÖÄäÃûº¯Êý»òÕßÄäÃûÀà¡£
1. ʲôÊDZհü£¿
ʲôÊDZհü£¿Ò»ÖÖÕýʽµÄ½âÊÍÊÇ£ºËùν±Õ°ü£¬Ö¸µÄÊÇÒ»ÖÖÓµÓкܶà±äÁ¿²¢ÇÒ°ó¶¨ÁËÕâЩ±äÁ¿µÄ»·¾³µÄ±í´ïÊ ......

JavaScriptÓï·¨¼¯½õ£¨Èý£©

 String¶ÔÏóµÄ charAt(x)¶ÔÏó ·´»ØÖ¸¶¨¶ÔÏóµÄµÚ¶àÉÙλµÄ×Öĸ
                     lastIndexOf("string") ´ÓÓÒµ½×óѯÕÒÖ¸¶¨×Ö·û£¬Ã»Óзµ»Ø-1
           ......

JavaScriptÓï·¨¼¯½õ£¨ËÄ£©

m=a.getMonth(); //»ñÈ¡Ô·ÝÖµ
d=a.getDate(); //»ñÈ¡ÈÕÆÚÖµ
d1=a.getDay(); //»ñÈ¡µ±Ç°ÐÇÆÚÖµ
h=a.getHours(); //»ñÈ¡µ±Ç°Ð¡Ê±Êý
m1=a.getMinutes(); //»ñÈ¡µ±Ç°·ÖÖÓÊý
s=a.getSeconds(); //»ñÈ¡µ±Ç°ÃëÖÓÊý
¶ÔÏó.style.fontSize="ÎÄ×Ö´óС";
µ¥Î»£ºmm/cm/inÓ¢´ç/pcÅÁ/ptµã/pxÏóËØ/emÎÄ×Ö¸ß
1in=1.25cm
1pc=12pt
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ