1. 程式人生 > >ASP.NET頁面顯示日期

ASP.NET頁面顯示日期

            <script language="JavaScript">
   <!--
   document.ns = navigator.appName == "Netscape"
   tmpDate = new Date();
   date = tmpDate.getDate();
   month= tmpDate.getMonth() + 1 ;
   if(document.ns)
   {
    year1=tmpDate.getYear()
    year= year1.toString().substr(1,2);
   }
   else
    year= tmpDate.getYear();
   
   document.write(year);
   document.write(".");
   document.write(month);
   document.write(".");
   document.write(date);
   // -->
    </script>