First: JavaScript displays the current system time code
December 1, 2015 12:05:08 Tuesday
<div id= "JNKC" >
</div>
<script>setinterval ("Jnkc.innerhtml=new Date (). toLocaleString () + ' Week ' + ' Day 123456 '. CharAt (New Date (). Getday ()); ", 1000);
</script>
Second: JavaScript displays the current system time code
December 1, 2015
<script language= "JavaScript" >
<!--
tmpdate = new Date ();
Date = Tmpdate.getdate ();
Month= Tmpdate.getmonth () + 1;
Year= tmpdate.getyear ();
document.write (year);
document.write ("year");
document.write (month);
document.write ("month");
document.write (date);
document.write ("Day");
-->
</script>
Third: JavaScript displays the current system time code
<!--time code start 2015-12-1 Week-->
<script language=javascript>
today=new Date ();
function Initarray () {
this.length=initarray.arguments.length for
(var i=0;i<this.length;i++)
this[ I+1]=initarray.arguments[i]}
var d=new initarray ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
document.write ("<font color= #0099ff >", Today.getyear (), "Year", Today.getmonth () +1, "Month", Today.getdate (), "Day", d[ Today.getday () +1], "</font>");
</SCRIPT>
<!--time Code end 2015-12-1 Week-->
Fourth (Firefox compatible): JavaScript Displays current system time code
<script language= "JavaScript" type= "Text/javascript" >
<!--
var enabled = 0; today = new Date ();
Var day; var date;
if (Today.getday () ==0) day = ' Sunday '
if (Today.getday () ==1) day = ' Monday '
if (Today.getday () ==2) day = ' Tuesday '
if (to Day.getday () ==3) day = "Wednesday"
if (Today.getday () ==4) day = "Thursday"
if (Today.getday () ==5) day = "Friday"
if (today. Getday () ==6) day = "Saturday"
date = (Today.getfullyear ()) + "year" + (Today.getmonth () + 1) + "month" + today.getdate () + "Days" + Day + "";
document.write (date);
-->
</script>
Fifth: JavaScript Displays the current system time code
<script language= "JavaScript" >
<!--
tmpdate = new Date ();
Date = Tmpdate.getdate ();
Month= Tmpdate.getmonth () + 1;
Year= tmpdate.getyear ();
document.write (year);
document.write ("year");
document.write (month);
document.write ("month");
document.write (date);
document.write ("Day");
-->
</script>
Sixth: JavaScript Displays the current system time code
<script language= "JavaScript" >
var ismonth = new
Array ("January", "February", "March", "April", "May", "June", "July", "August", "September" "," October "," November "," December ");
var isday = new
Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
Today = new Date ();
Year=today.getyear ();
Date=today.getdate ();
if (document.all)
document.title= "Today is:" +year+ "Year" +ismonth[today.getmonth ()]+date+ "Day" +isday[today.getday ()]
</script>
In IE title bar to display the date time of the JS code
Can let the time, the date displays in your webpage title bar, very individuality function, in fact the code is very simple, saw will, also very good call.
<title> page title bar display time </title>
<script language= "JavaScript" >
var ismonth = new
Array ("January") , "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var isday = new
Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
Today = new Date ();
Year=today.getyear ();
Date=today.getdate ();
if (document.all)
document.title= "Today is:" +year+ "Year" +ismonth[today.getmonth ()]+date+ "Day" +isday[today.getday ()]
</script>
The above six kinds of JavaScript show the current system time method, which one favorite method, we can carefully contrast, choose the most suitable one to use.