Php displays the current time in real time
". $ N; echo" document. write ('?
');". $ N; echo "var y = ". date ("Y "). "; // year ". $ n; echo "var m = ". date ("n "). "; // month ". $ n; echo "var d = ". date ("j "). "; // Day ". $ n; echo "var w = ". date ("w "). "; // Star ". $ n; echo "var h = ". date ("H "). "; // hour ". $ n; echo "var I = ". date ("I "). "; // minute ". $ n; echo "var s = ". date ("s "). "; // Second ". $ n; echo "var hstr = istr = sstr = a = '';". $ n; echo "var ww = Array ('day', 'yi', '2', '3', '4', '5', '6 '); ". $ n; echo "function clock (){". $ n; echo "s ++ ;". $ n; ech O "if (s = 60) {I + = 1; s = 0;} // second Carry ". $ n; echo "if (I = 60) {h + = 1; I = 0;} // carry-in ". $ n; echo "if (h = 24) {w + = 1; d + = 1; h = 0;} // Time bit ". $ n; echo "if (w = 7) {w = 0;} // week carry ". $ n; echo "if (m = 2) {// is it July? ". $ N; echo" if (! Y % 4> 0) {// not a leap month (28 days on January 1, February )". $ n; echo "if (d = 30 ){". $ n; echo "m + = 1 ;". $ n; echo "d = 1 ;}". $ n; echo "}". $ n; echo "else {// It is a leap month (29 days on January 1, February )". $ n; echo "if (d = 29 ){". $ n; echo "m + = 1 ;". $ n; echo "d = 1 ;}". $ n; echo "}". $ n; echo "}". $ n; echo "else {// month other than January 1, February ". $ n; echo "if (m = 4 | m = 6 | m = 9 | m = 11) {// only 30 days of the month ". $ n; echo "if (d = 31 ){". $ n; echo "m + = 1 ;". $ n; echo "d = 1 ;}". $ n; echo "}". $ n; echo "else {// Month with 31 days ". $ n; echo "if (d = 32 ){". $ n; echo "m + = 1 ;". $ n; echo "d = 1 ;}". $ n; echo "}". $ n; echo "}". $ n; echo "if (m = 13) {y + = 1; m = 1;} // carry Monthly ". $ n; echo "if (h <10) {hstr = '0' + h} else {hstr ='' + h };". $ n; echo "if (I <10) {istr = ': 0' + I} else {istr =': '+ I };". $ n; echo "if (s <10) {sstr = ': 0' + s} else {sstr =': '+ s };". $ n; echo "if (h <13) {astr = 'am';} else {astr = 'PM ';};". $ n; echo "TimeShow. innerHTML = y + 'Year' + m + 'month' + d + 'day' + 'week' + ww [w] + ''+ hstr + istr + sstr + astr ;". $ n; echo "setTimeout ('clock () ', 1000 );". $ n; echo "}". $ n; echo "clock ();". $ n; echo "SCRIPT". $ n;?>