how to get the time wriiten in JavaScript coding?
How to get the time written in Java-Script coding?
%26lt;script language="JavaScript"%26gt;%26lt;!--
var months = new Array();
months[0] = 'January';
months[1] = 'February';
months[2] = 'March';
months[3] = 'April';
months[4] = 'May';
months[5] = 'June';
months[6] = 'July';
months[7] = 'August';
months[8] = 'September';
months[9] = 'October';
months[10] = 'November';
months[11] = 'December';
var days = new Array();
days[0] = 'Sunday';
days[1] = 'Monday';
days[2] = 'Tuesday';
days[3] = 'Wednesday';
days[4] = 'Thursday';
days[5] = 'Friday';
days[6] = 'Saturday';
now = new Date();
var Hours;
var Mins;
var Time;
var dayname = days[now.getDay()];
var monthname = months[now.getMonth()];
var dayofmonth =now.getDate();
var year = now.getYear();
if (year %26lt; 1000) year += 1900;
Hours = now.getHours();
if (Hours %26gt;= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}
if (Hours %26gt; 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = now.getMinutes();
if (Mins %26lt; 10) {
Mins = "0" + Mins;
}
document.write('%26lt;FONT SIZE="2" FACE="Verdana" COLOR="#FFFFFF"%26gt;');
document.write(dayname + ' - ' + monthname + ' ' + dayofmonth + ', ' + year);
document.write(' - ' + Hours + ":" + Mins + Time + '');
// --%26gt;%26lt;/script%26gt;
Reply:all thinks in java scripts
Reply:Try this link
http://www.computerhope.com/j2.htm
jainnys
Mind Experts Inc.
http://www.mindexp.com
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment