TShopping

 找回密碼
 註冊
搜索
查看: 1737|回復: 2
打印 上一主題 下一主題

[教學] 精緻的日期顯示

[複製鏈接]
跳轉到指定樓層
1#
發表於 2008-6-1 19:02:46 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
 
Push to Facebook
  1. <Body><p align="center"><font SIZE="2" COLOR="#a00000"><b><script Language="javascript">
  2. <!--
  3. function visitor()
  4. {
  5. //define variable
  6. var Jsay;
  7. var Jdayr;
  8. var Jtoday= new Date();
  9. var Jyear= Jtoday.getYear(); Jmonth=Jtoday.getMonth();
  10. Jday= Jtoday.getDay(); Jdate=Jtoday.getDate();
  11. Jhrs= Jtoday.getHours(); Jmin=Jtoday.getMinutes();
  12. Jsec=Jtoday.getSeconds();

  13. if (Jhrs<12)
  14. document.write("<font color=red>早安</font>");
  15. else if ( Jhrs<18)
  16. document.write("<font color=red>午安</font>");
  17. else
  18. document.write("<font color=red>晚安</font>");
  19. document.write('\t'+'! ');
  20. document.write('<font color="#0000ff">今天是<font color=blue>' + (Jmonth+1) );
  21. document.write("</font>月<font color=blue>"+Jdate+"</font>日");
  22. if (Jday==1)
  23. document.write("星期<font color=blue>一</font>");
  24. else if (Jday==2)
  25. document.write("星期<font color=blue>二</font>");
  26. else if (Jday==3)
  27. document.write("星期<font color=blue>三</font>");
  28. else if (Jday==4)
  29. document.write("星期<font color=blue>四</font>");
  30. else if (Jday==5)
  31. document.write("星期<font color=blue>五</font>");
  32. else if (Jday==6)
  33. document.write("星期<font color=red>六</font>");
  34. else if (Jday==0)
  35. document.write("星期<font color=red>日</font>");
  36. }
  37. visitor();
  38. // -->
  39. </script>
  40. 時間<script Language="javascript">
  41. <!--
  42. //define variable
  43. var Jsay;
  44. var Jdayr;
  45. var Jtoday= new Date();
  46. var Jyear= Jtoday.getYear(); Jmonth=Jtoday.getMonth();
  47. Jday= Jtoday.getDay(); Jdate=Jtoday.getDate();
  48. Jhrs= Jtoday.getHours(); Jmin=Jtoday.getMinutes();
  49. Jsec=Jtoday.getSeconds();
  50. document.write('<font color=blue>'+Jhrs+':'+Jmin+'</font>分');
  51. //-->
  52. </script> </b></font></p></Body>
複製代碼

 

臉書網友討論
2#
發表於 2013-11-13 01:09:28 | 只看該作者
好阿,謝版主

版主招募中

3#
發表於 2013-11-13 01:09:28 | 只看該作者
支持你加分  


*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-4-19 15:05 , Processed in 0.043181 second(s), 19 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表